<template>
	<!-- 核保处理-详情 -->
	<div class="underwriting">
		<div class="print-pop" v-show="isPrint"> </div>
		<div v-if="subUnLoading" v-loading="subUnLoading" element-loading-text="拼命加载中..."
			element-loading-spinner="el-icon-loading" class="sub-loading">
		</div>
		<div class="underwriting-base" v-loading.fullscreen.lock="fullscreenLoading">
			<div class="posi-abs-top">
				<span class="lab">{{vip}}</span>
				<span class="lab ml10">非高净值客户</span>
			</div>
			<el-tabs v-model="activeName" @tab-click="handleClick" class="base-title">
				<el-tab-pane :label="insTabInfo.name" name="first" class="item-title">
					<el-row>
						<el-col :span="3">
							<div><span class="item" @click="showItem(0)">累计保额</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsHistorys">
								<span class="item" @click="showItem(1)"> 投保记录({{insTabInfo.insCount}})</span>
							</div>
							<div v-else><span class="item">投保记录(<i class="el-icon-loading"></i>)</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsNotepads">
								<span class="item" @click="showItem(2)"> Notepad（{{insNoteSize}}）</span>
							</div>
							<div v-else> <span class="item">Notepad（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsCus">
								<span class="item" @click="showItem(21)">客户查询（{{insCusSize}}）</span>
							</div>
							<div v-else><span class="item">客户查询（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsPoss">
								<span class="item" @click="showItem(3)"> 保全记录（{{insTabInfo.insPoss.length}}）</span>
							</div>
							<div v-else><span class="item">保全记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsClaims">
								<span class="item" @click="showItem(4)">理赔记录（{{insTabInfo.insClaims.length}}）</span>
							</div>
							<div v-else><span class="item">理赔记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsRenews">
								<span class="item" @click="showItem(5)">续核记录（{{insTabInfo.insRenewscount}}）</span>
							</div>
							<div v-else><span class="item">续核记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsHealths">
								<span class="item" @click="showItem(6)">异常告知一览（{{insTabInfo.insHealths.length}}）</span>
							</div>
							<div v-else><span class="item">异常告知一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsExams">
								<span class="item" @click="showItem(7)">体检报告一览（{{insTabInfo.insExams.length}}）</span>
							</div>
							<div v-else><span class="item">体检报告一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsSupplements">
								<span class="item"
									@click="showItem(8)">补充告知一览（{{insTabInfo.insSupplements.length}}）</span>
							</div>
							<div v-else><span class="item">补充告知一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsComplaints">
								<span class="item" @click="showItem(9)">客户投诉记录（{{insTabInfo.complaints}}）</span>
							</div>
							<div v-else><span class="item">客户投诉记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isInsPres">
								<span class="item" @click="showItem(20)">预核保（{{insTabInfo.insPres.length}}）</span>
							</div>
							<div v-else><span class="item">预核保（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div>
								<span class="item" @click="toCustomerInfo(insTabInfo)">客户关系图谱</span>
							</div>
						</el-col>
					</el-row>
				</el-tab-pane>
        <!-- 第二被保人需求 start -->
        <el-tab-pane :label="secondInsTabInfo.name" name="second" class="item-title">
          <el-row>
            <el-col :span="3">
              <div><span class="item" @click="secondShowItem(0)">累计保额</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsHistorys">
                <span class="item" @click="secondShowItem(1)"> 投保记录({{secondInsTabInfo.insCount}})</span>
              </div>
              <div v-else><span class="item">投保记录(<i class="el-icon-loading"></i>)</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsNotepads">
                <span class="item" @click="secondShowItem(2)"> Notepad（{{secondInsNoteSize}}）</span>
              </div>
              <div v-else> <span class="item">Notepad（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsCus">
                <span class="item" @click="secondShowItem(21)">客户查询（{{secondInsCusSize}}）</span>
              </div>
              <div v-else><span class="item">客户查询（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsPoss">
                <span class="item" @click="secondShowItem(3)"> 保全记录（{{secondInsTabInfo.insPoss.length}}）</span>
              </div>
              <div v-else><span class="item">保全记录（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsClaims">
                <span class="item" @click="secondShowItem(4)">理赔记录（{{secondInsTabInfo.insClaims.length}}）</span>
              </div>
              <div v-else><span class="item">理赔记录（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsRenews">
                <span class="item" @click="secondShowItem(5)">续核记录（{{secondInsTabInfo.insRenewscount}}）</span>
              </div>
              <div v-else><span class="item">续核记录（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsHealths">
                <span class="item" @click="secondShowItem(6)">异常告知一览（{{secondInsTabInfo.insHealths.length}}）</span>
              </div>
              <div v-else><span class="item">异常告知一览（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsExams">
                <span class="item" @click="secondShowItem(7)">体检报告一览（{{secondInsTabInfo.insExams.length}}）</span>
              </div>
              <div v-else><span class="item">体检报告一览（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsSupplements">
								<span class="item"
                      @click="secondShowItem(8)">补充告知一览（{{secondInsTabInfo.insSupplements.length}}）</span>
              </div>
              <div v-else><span class="item">补充告知一览（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsComplaints">
                <span class="item" @click="secondShowItem(9)">客户投诉记录（{{secondInsTabInfo.complaints}}）</span>
              </div>
              <div v-else><span class="item">客户投诉记录（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div v-if="isSecondInsPres">
                <span class="item" @click="secondShowItem(20)">预核保（{{secondInsTabInfo.insPres.length}}）</span>
              </div>
              <div v-else><span class="item">预核保（<i class="el-icon-loading"></i>）</span></div>
            </el-col>
            <el-col :span="3">
              <div>
                <span class="item" @click="toCustomerInfo(secondInsTabInfo)">客户关系图谱</span>
              </div>
            </el-col>
          </el-row>
        </el-tab-pane>
        <!-- 第二被保人需求 end -->
				<el-tab-pane v-for="(item, index) in tabInsList" :label="item.appTabInfo.name"
					:name="item.appTabInfo.tabname" class="item-title" :ref="`ref${index}`">
					<el-row>
						<el-col :span="3">
							<div>
								<span class="item" @click="showItem(0)">累计保额</span>
							</div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppHistorys">
								<span class="item" @click="showItem(1)">投保记录({{item.appTabInfo.appCount}})</span>
							</div>
							<div v-else><span class="item">投保记录(<i class="el-icon-loading"></i>)</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppNotepads">
								<span class="item" @click="showItem(2)">
									Notepad（{{item.appTabInfo.appNotepads.length}}）</span>
							</div>
							<div v-else><span class="item">Notepad（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppCus">
								<span class="item" @click="showItem(22)">客户查询（{{item.appTabInfo.appCusSize}}）</span>
							</div>
							<div v-else><span class="item">客户查询（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppPoss">
								<span class="item" @click="showItem(3)">保全记录（{{item.appTabInfo.appPoss.length}}）</span>
							</div>
							<div v-else><span class="item">保全记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppClaims">
								<span class="item"
									@click="showItem(4)">理赔记录（{{item.appTabInfo.appClaims.length}}）</span>
							</div>
							<div v-else><span class="item">理赔记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppRenews">
								<span class="item" @click="showItem(5)">续核记录（{{item.appTabInfo.appRenewscount}}）</span>
							</div>
							<div v-else><span class="item">续核记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppHealths">
								<span class="item"
									@click="showItem(6)">异常告知一览（{{item.appTabInfo.appHealths.length}}）</span>
							</div>
							<div v-else><span class="item">异常告知一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppExams">
								<span class="item"
									@click="showItem(7)">体检报告一览（{{item.appTabInfo.appExams.length}}）</span>
							</div>
							<div v-else><span class="item">体检报告一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppSupplements">
								<span class="item"
									@click="showItem(8)">补充告知一览（{{item.appTabInfo.appSupplements.length}}）</span>
							</div>
							<div v-else><span class="item">补充告知一览（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div v-if="isAppComplaints">
								<span class="item" @click="showItem(9)">客户投诉记录（{{item.appTabInfo.complaints}}）</span>
							</div>
							<div v-else><span class="item">客户投诉记录（<i class="el-icon-loading"></i>）</span></div>
						</el-col>
						<el-col :span="3">
							<div>
								<span class="item" @click="showItem(10)">个人税收居民身份</span>
							</div>
						</el-col>
						<el-col :span="3">
							<div>
								<span class="item" @click="showItem(11)">委托人信息</span>
							</div>
						</el-col>
						<el-col :span="3">
							<div>
								<span class="item" @click="toCustomerInfo(item.appTabInfo)">客户关系图谱</span>
							</div>
						</el-col>
					</el-row>
				</el-tab-pane>

			</el-tabs>
			<el-row class="base-mian">
				<div v-if="isInsureTab">
					<!-- 投保记录 -->
					<insurance-records v-if="recordFlag" :recordFlag="recordFlag" :historys="insTabInfo.insHistorys"
						@showLoading="showLoading" @subRecordFlag="getSubRecordFlag"></insurance-records>

					<!-- 客户投诉记录 -->
					<customer-complaint v-if="complainFlag" :complainFlag="complainFlag" :clntnum="insTabInfo.clntnum"
						@showLoading="showLoading" @subComplainFlag="getSubComplainFlag"></customer-complaint>

					<!-- 累计保额 -->
					<accumulated-premium v-if="cumAmountFlag" :cumAmountFlag="cumAmountFlag"
						:clntnum="insTabInfo.clntnum" @showLoading="showLoading" :showAmount="showAmount"
						:applnum="curPageData.euaa.applnum" :name ="curPageData.insLasInfo.name"
						@subCumAmountFlag="getSubCumAmountFlag"></accumulated-premium>

					<!-- 理赔记录 -->
					<claims-records v-if="claimsFlag" :claimsFlag="claimsFlag" @showLoading="showLoading"
						:customerNo="insTabInfo.clntnum" :chdrnum="claimChdrnum" :applnum="curPageData.euaa.applnum" @subClaimsFlag="getSubClaimsFlag">
					</claims-records>

					<!-- 保全记录 -->
					<keep-record v-if="saveDamageFlag" :saveDamageFlag="saveDamageFlag" @showLoading="showLoading"
						:usercomp="curPageData.unipndPageList[0].usercomp" :poss="insTabInfo.insPoss"
						@subSaveDamageFlag="getSubSaveDamageFlag"></keep-record>

					<!-- 异常告知一览 -->
					<abnormal-told v-if="abnormityFlag" :abnormityFlag="abnormityFlag" :healths="insTabInfo.insHealths"
						@showLoading="showLoading" @subAbnormityFlag="getSubAbnormityFlag"></abnormal-told>

					<!-- 补充告知书一览 -->
					<supplementary-told v-if="reportFlag" :reportFlag="reportFlag" :clntnum="insTabInfo.clntnum"
						@showLoading="showLoading" @subReportFlag="getSubReportFlag"></supplementary-told>


					<!-- 体检报告一览 -->
					<medical-report v-if="healthFlag" :healthFlag="healthFlag" :clntnum="insTabInfo.clntnum"
						@showLoading="showLoading" @subHealthFlag="getSubHealthFlag"></medical-report>

					<!-- Notepad -->
					<notepad v-if="notepadFlag" :insTabInfo="JSON.stringify(insTabInfo)"
						:appTabInfo="JSON.stringify(curInsPageData.appTabInfo)" @insNoteSize="getInsNoteSize"
						:applnum="curPageData.curApplnum" :allInfoReadOnly="curPageData.allInfoReadOnly"
						:curUserId="userId" reqtype="ins" @showLoading="showLoading" :notepadFlag="notepadFlag"
						@subNotepadFlag="getSubNotepadFlag"></notepad>

					<!-- 续核记录 -->
					<review-opinion v-if="reviewFlag" :reviewFlag="reviewFlag" @showLoading="showLoading"
						:clntnum="insTabInfo.clntnum" @subReviewFlag="getSubReviewFlag"></review-opinion>

					<!-- 预核保 -->
					<pres v-if="presFlag" :presFlag="presFlag" :applnum="curPageData.curApplnum"
						:isRead="allInfoReadOnly" @initPre="getPres" @showLoading="showLoading"
						:cardno="insTabInfo.cardno" :datas="insTabInfo.insPres" @subPreFlag="getSubPreFlag"></pres>

					<!-- 被保人客户查询 -->
					<customer-info v-if="insCusFlag" @showLoading="showLoading" :applnum="curPageData.curApplnum"
						reqtype="ins" :cusFlag="insCusFlag" @subCusFlag="getSubInsCusFlag"></customer-info>
				</div>

			</el-row>

      <!-- 第二被保人需求  start -->
      <el-row class="base-mian">
        <div v-if="isSecondInsureTab">
          <!-- 投保记录 -->
          <insurance-records v-if="secondRecordFlag" :recordFlag="secondRecordFlag" :historys="secondInsTabInfo.insHistorys"
                             @showLoading="showLoading" @subRecordFlag="getSecondSubRecordFlag"></insurance-records>

          <!-- 客户投诉记录 -->
          <customer-complaint v-if="secondComplainFlag" :complainFlag="secondComplainFlag" :clntnum="secondInsTabInfo.clntnum"
                              @showLoading="showLoading" @subComplainFlag="getSecondSubComplainFlag"></customer-complaint>

          <!-- 累计保额 -->
          <accumulated-premium v-if="secondCumAmountFlag" :cumAmountFlag="secondCumAmountFlag"
                               :clntnum="secondInsTabInfo.clntnum" @showLoading="showLoading" :showAmount="showAmount"
                               :applnum="curPageData.euaa.applnum" :name ="curPageData.secondInsLasInfo.name"
                               @subCumAmountFlag="getSecondSubCumAmountFlag"></accumulated-premium>

          <!-- 理赔记录 -->
          <claims-records v-if="secondClaimsFlag" :claimsFlag="secondClaimsFlag" @showLoading="showLoading"
                          :customerNo="secondInsTabInfo.clntnum" :chdrnum="claimChdrnum" @subClaimsFlag="getSecondSubClaimsFlag">
          </claims-records>

          <!-- 保全记录 -->
          <keep-record v-if="secondSaveDamageFlag" :saveDamageFlag="secondSaveDamageFlag" @showLoading="showLoading"
                       :usercomp="curPageData.unipndPageList[0].usercomp" :poss="secondInsTabInfo.insPoss"
                       @subSaveDamageFlag="getSecondSubSaveDamageFlag"></keep-record>

          <!-- 异常告知一览 -->
          <abnormal-told v-if="secondAbnormityFlag" :abnormityFlag="secondAbnormityFlag" :healths="secondInsTabInfo.insHealths"
                         @showLoading="showLoading" @subAbnormityFlag="getSecondSubAbnormityFlag"></abnormal-told>

          <!-- 补充告知书一览 -->
          <supplementary-told v-if="secondReportFlag" :reportFlag="secondReportFlag" :clntnum="secondInsTabInfo.clntnum"
                              @showLoading="showLoading" @subReportFlag="getSecondSubReportFlag"></supplementary-told>


          <!-- 体检报告一览 -->
          <medical-report v-if="secondHealthFlag" :healthFlag="secondHealthFlag" :clntnum="secondInsTabInfo.clntnum"
                          @showLoading="showLoading" @subHealthFlag="getSecondSubHealthFlag"></medical-report>

          <!-- Notepad -->
          <notepad v-if="secondNotepadFlag" :insTabInfo="JSON.stringify(secondInsTabInfo)"
                   :appTabInfo="JSON.stringify(curInsPageData.appTabInfo)" @insNoteSize="getSecondInsNoteSize"
                   :applnum="curPageData.curApplnum" :allInfoReadOnly="curPageData.allInfoReadOnly"
                   :curUserId="userId" reqtype="ins" @showLoading="showLoading" :notepadFlag="secondNotepadFlag"
                   @subNotepadFlag="getSecondSubNotepadFlag"></notepad>

          <!-- 续核记录 -->
          <review-opinion v-if="secondReviewFlag" :reviewFlag="secondReviewFlag" @showLoading="showLoading"
                          :clntnum="secondInsTabInfo.clntnum" @subReviewFlag="getSecondSubReviewFlag"></review-opinion>

          <!-- 预核保 -->
          <pres v-if="secondPresFlag" :presFlag="secondPresFlag" :applnum="curPageData.curApplnum"
                :isRead="allInfoReadOnly" @initPre="getSecondPres" @showLoading="showLoading"
                :cardno="secondInsTabInfo.cardno" :datas="secondInsTabInfo.insPres" @subPreFlag="getSecondSubPreFlag"></pres>

          <!-- 被保人客户查询 -->
          <customer-info v-if="secondInsCusFlag" @showLoading="showLoading" :applnum="curPageData.curApplnum"
                         reqtype="ins2" :cusFlag="secondInsCusFlag" @subCusFlag="getSecondSubInsCusFlag"></customer-info>
        </div>

      </el-row>
      <!-- 第二被保人需求  end -->

			<el-row class="base-mian">
				<div v-if="isAppTab">
					<!-- 投保记录 -->
					<insurance-records v-if="appRecordFlag" :recordFlag="appRecordFlag"
						:historys="curInsPageData.appTabInfo.appHistorys" @showLoading="showLoading"
						@subRecordFlag="getAppRecordFlag"></insurance-records>

					<!-- 客户投诉记录 -->
					<customer-complaint v-if="appComplainFlag" :complainFlag="appComplainFlag"
						:clntnum="curInsPageData.appTabInfo.clntnum" @showLoading="showLoading"
						@subComplainFlag="getAppComplainFlag"></customer-complaint>

					<!-- 累计保额 -->
					<accumulated-premium v-if="appCumAmountFlag" :cumAmountFlag="appCumAmountFlag"
						:clntnum="curInsPageData.appTabInfo.clntnum"
						:showAmount="showAmount" :applnum="curPageData.euaa.applnum" :name="curPageData.appBaseInfo.name"
						 @showLoading="showLoading"
						@subCumAmountFlag="getAppCumAmountFlag"></accumulated-premium>

					<!-- 理赔记录 -->
					<claims-records v-if="appClaimsFlag" :claimsFlag="appClaimsFlag" @showLoading="showLoading"
						:customerNo="curInsPageData.appTabInfo.clntnum" :chdrnum="claimChdrnum" :applnum="curPageData.euaa.applnum"
						@subClaimsFlag="getAppClaimsFlag"></claims-records>

					<!-- 保全记录 -->
					<keep-record v-if="appSaveDamageFlag" :saveDamageFlag="appSaveDamageFlag" @showLoading="showLoading"
						:usercomp="curInsPageData.unipndPageList[0].usercomp" :poss="curInsPageData.appTabInfo.appPoss"
						@subSaveDamageFlag="getAppSaveDamageFlag"></keep-record>

					<!-- 异常告知一览 -->
					<abnormal-told v-if="appAbnormityFlag" :abnormityFlag="appAbnormityFlag"
						:healths="curInsPageData.appTabInfo.appHealths" @showLoading="showLoading"
						@subAbnormityFlag="getAppAbnormityFlag"></abnormal-told>

					<!-- 补充告知书一览 -->
					<supplementary-told v-if="appReportFlag" :reportFlag="appReportFlag" @showLoading="showLoading"
						:clntnum="curInsPageData.appTabInfo.clntnum" @subReportFlag="getAppReportFlag">
					</supplementary-told>

					<!-- 委托人信息 -->
					<consignor v-if="appConsignorFlag" :appConsignorFlag="appConsignorFlag"
						:allInfoReadOnly="curInsPageData.allInfoReadOnly" :applnum="curInsPageData.curApplnum"
						:euaa="JSON.stringify(curInsPageData.euaa)" @showLoading="showLoading"
						@subConsignorFlag="getAppConsignorFlag"></consignor>

					<!-- 体检报告一览 -->
					<medical-report v-if="appHealthFlag" :healthFlag="appHealthFlag"
						:clntnum="curInsPageData.appTabInfo.clntnum" @showLoading="showLoading"
						@subHealthFlag="getAppHealthFlag"></medical-report>

					<!-- Notepad -->
					<notepad v-if="appNotepadFlag" :insTabInfo="JSON.stringify(insTabInfo)"
						:appTabInfo="JSON.stringify(curInsPageData.appTabInfo)" @appNoteSize="getAppNoteSize"
						:applnum="curInsPageData.curApplnum" :allInfoReadOnly="curInsPageData.allInfoReadOnly"
						:curUserId="userId" reqtype="app" @showLoading="showLoading" :notepadFlag="appNotepadFlag"
						@subNotepadFlag="getAppNotepadFlag"></notepad>

					<!-- 个人税收居民身份证明 -->
					<identity-card v-if="appIDFlag" :IDFlag="appIDFlag"
						:allInfoReadOnly="curInsPageData.allInfoReadOnly" @showLoading="showLoading"
						:applnum="curInsPageData.curApplnum" :clntnum="curInsPageData.appBaseInfo.clntnum"
						@subIDFlag="getAppIDFlag"></identity-card>

					<!-- 续核记录 -->
					<review-opinion v-if="appReviewFlag" :reviewFlag="appReviewFlag" @showLoading="showLoading"
						:clntnum="curInsPageData.appBaseInfo.clntnum" @subReviewFlag="getAppReviewFlag">
					</review-opinion>

					<!-- 投保人客户查询 -->
					<customer-info v-if="appCusFlag" @showLoading="showLoading" :applnum="curInsPageData.curApplnum"
						reqtype="app" :cusFlag="appCusFlag" @subCusFlag="getSubAppCusFlag"></customer-info>
				</div>

			</el-row>

			<div class="policy-main">
				<!-- 右侧操作按钮 -->
				<suspend-nav @saveAllInfo="beforeSaveInfo" @toCreateInfo="toCreateInfo" @back="back" @jump="jump"
					@toEditInfo="toEditInfo" :allInfoReadOnly="allInfoReadOnly" :notOperation="curPageData.notOperation"
					:pageSource="pageSource"></suspend-nav>

				<div class="policy-main-title">
					<i class="el-icon-tickets"></i>
					<span>保单信息</span>
				</div>
				<div class="policy-main-container">
					<el-row class="tabs">
						<el-col :span="4" v-for="(item, index) in pageData" :key="index" class="tabs-item">
							<div :class="{ 'active' : curPageData.chdrnum == item.chdrnum}"
								@click="changePolicy(item.chdrnum)">保单号：{{item.chdrnum}}</div>
						</el-col>
					</el-row>
					<el-row class="main">
						<el-row v-for="(item, index) in pageData" :key="index">
							<div v-if="curPageData.chdrnum == item.chdrnum">
								<!--保单信息-->
								<el-col :span="24" class="main-cell">
									<div class="main-cell-title">
										<span class="line">|</span>
										<span>保单基本信息</span>
									</div>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">受理号:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.applnum}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">保单号:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.chdrnum}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">电子投保标识号:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.serno}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">渠道:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.srcebus}}</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">所属机构:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.org}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">照会单位:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.tsalesdsc1}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">业务代表:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.as_agntname01}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">营销员等级:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.as_agentClass01}}</span>
												<span class="com-txt-line ml10"
													@click="salesShow(item.euaa)">营销员信息</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">处理状态:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.procflg | procflgPige}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">受理日期:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.as_hprrcvdt}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">投保日期:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.as_appldate}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">计费回溯日:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.caldate}}</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">首次核保日期:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.firstApplDate}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">核保日期:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.dateup04}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">照会日期:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.pnappdate}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="11">
												<label class="complain-lab">照会回复截止日期:</label>
											</el-col>
											<el-col :span="13">
												<span class="com-txt">{{item.euaa.pnBackDate}}</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">缴别:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.billfreq | billfreqPige}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">应缴总保费:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt"
													v-if="item.euaa.as_instprem==null || item.euaa.as_instprem==0 || item.euaa.as_instprem=='0'">0.00</span>
												<span class="com-txt" v-else>{{item.euaa.as_instprem}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">实缴总保费:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.as_payment.toFixed(2)}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">短溢缴:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{(item.euaa.as_dyj)}}</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">CAMPAIGN:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt"
													v-if="item.euaa.srcebus != 'AG'">{{item.euaa.campaign}}</span>
												<!--                                                <span class="com-txt" v-else>{{item.euaa.campaign}}</span>-->
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">多模式代码:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.modecode}}</span>
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">GROUP:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt"
													v-if="item.euaa.srcebus== 'AG'">{{item.euaa.campaign}}</span>
												<!--                                                <span class="com-txt" v-else></span>-->
											</el-col>
										</el-col>
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">体检别:</label>
											</el-col>
											<el-col :span="14">
												<span class="com-txt">{{item.euaa.mmflg | mmflgPige}}</span>
											</el-col>
										</el-col>
									</el-col>
									<el-col :span="24" class="mb10">
										<el-col :span="6">
											<el-col :span="10">
												<label class="complain-lab">短期险是否续保:</label>
											</el-col>
											<el-col :span="14" v-for="(euab,index) in item.trailer4" :key='index'>
												<span class="com-txt"
													v-if="euab.statFund=='M' && euab.uwind=='Y'">是</span>
												<span class="com-txt"
													v-else-if="euab.statFund=='M' && euab.uwind=='N'">否</span>
												<span class="com-txt" v-else></span>
											</el-col>
										</el-col>

									</el-col>
								</el-col>
								<!--投被保人信息-->
								<el-col :span="24" class="main-cell position-re">
									<!-- <div class="position-abs-left pl30">
										<span class="lab" @click="showImageList(item.euaa.applnum)">查看影像</span>
									</div> -->
									<div class="position-abs-right">
										<span class="lab" @click="showImageList(item.euaa.applnum)">查看影像</span>
										<span class="lab ml20" @click="mz(item)">iRisk信息</span>
										<span class="lab ml20" @click="pv(item)" v-show="pvTabFlag">PowerView信息</span>
										<span style="pointer-events:none; margin-left: 1.25rem;" class="lab"
											@click="brpt(item)">百融平台</span>
										<span style="pointer-events:none;" class="lab ml20"
											@click="ebcypt(item)">亿保创元平台</span>
										<span style="pointer-events:none;" class="lab ml20"
											@click="zbxyjx(item)">中保信意健险</span>
										<span style="pointer-events:none;" class="lab ml20"
											@click="zbxyhkyz(item)">中保信银行卡验真</span>
										<span class="lab ml20" @click="showCheat(item)">欺诈信息查询</span>
									</div>
									<el-tabs v-model="activeName2" type="border-card" @tab-click="handleClick1(item)">
										<el-tab-pane label="被保险人信息" name="first">
											<el-tabs v-model="activeName3" type="card" class="mt10">
												<el-tab-pane label="基本信息" name="first" class="person">
													<el-row>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">姓名:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.insLasInfo.name">{{item.insLasInfo.name}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">国籍:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.insLasInfo.ctrycode">{{item.insLasInfo.ctrycode}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">性别:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.sex}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">证件类型:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.idcardtype}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">证件号码:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt-line com-txt"
																	@click="toShowCustomer(item.insLasInfo.cardno)">{{item.insLasInfo.cardno}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">职业:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.insLasInfo.occpcden +' '+ item.insLasInfo.doccdesco +' '+ item.insLasInfo.occpLvl">{{item.insLasInfo.occpcden}}
																	{{item.insLasInfo.doccdesco}}
																	{{item.insLasInfo.occpLvl}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">工作单位:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.insLasInfo.workUnit">{{item.insLasInfo.workUnit}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">出生日期:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.birthday}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">风险等级:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.risklvl}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">身高(厘米):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.height}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">体重(公斤):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.weight}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">体格指数:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.bmi}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">年龄:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.age}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期类型:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.cardflag}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期起始日:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.dateup02}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期截止日:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.dateup}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">通讯地址:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.insLasInfo.addr01">{{item.insLasInfo.addr01}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">年收入(万元):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.insLasInfo.anne}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">手机:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.moblie01}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">单位电话:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.moblie03}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">住宅电话:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.insLasInfo.moblie02}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="24">
																<label class="com-txt-line"
																	@click="showNameInfo(0,item)">被保人英文/拼音姓名</label>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="24">
																<label class="com-txt-line"
																	@click="showBaseInfo(0,item)">客户资料信息比对</label>
															</el-col>

														</el-col>
													</el-row>
												</el-tab-pane>
												<el-tab-pane label="健康告知信息" name="second">
													<el-table :data="item.insHealthInfo">
														<el-table-column type="index" label="序号" min-width="100"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="surname" label="姓名" min-width="50"
															show-overflow-tooltip></el-table-column>
														<!--                                                        <el-table-column property="informno" label="代码" min-width="40" show-overflow-tooltip></el-table-column>-->
														<el-table-column property="informdesc" label="题目"
															min-width="470" show-overflow-tooltip></el-table-column>
														<el-table-column property="notedesc" label="说明" min-width="100"
															show-overflow-tooltip></el-table-column>
													</el-table>
												</el-tab-pane>
												<el-tab-pane label="智能核保结论及问答" name="third">
													<el-table :data="item.insAnswer">
														<el-table-column type="index" label="题号" min-width="100"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="icdName" label="疾病名称" min-width="120"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="questionName" label="问题"
															min-width="120" show-overflow-tooltip></el-table-column>
														<el-table-column property="answerContent" label="说明"
															min-width="300" show-overflow-tooltip></el-table-column>
														<el-table-column property="conclusion" label="智能核结论"
															min-width="120" show-overflow-tooltip></el-table-column>
													</el-table>
												</el-tab-pane>
											</el-tabs>
										</el-tab-pane>
                    <!-- 第二被保人需求 start -->
                    <el-tab-pane v-if="item.secondInsLasInfo" label="第二被保险人信息" name="third">
                      <el-tabs v-model="activeName6" type="card" class="mt10">
                        <el-tab-pane label="基本信息" name="first" class="person">
                          <el-row>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">姓名:</label>
                              </el-col>
                              <el-col :span="14" class="div-txt">
																<span class="com-txt"
                                      :title="item.secondInsLasInfo.name">{{item.secondInsLasInfo.name}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">国籍:</label>
                              </el-col>
                              <el-col :span="14" class="div-txt">
																<span class="com-txt"
                                      :title="item.secondInsLasInfo.ctrycode">{{item.secondInsLasInfo.ctrycode}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">性别:</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.sex}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">证件类型:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.idcardtype}}</span>
                              </el-col>
                            </el-col>
                          </el-row>
                          <el-row class="mt10">
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">证件号码:</label>
                              </el-col>
                              <el-col :span="14">
																<span class="com-txt-line com-txt"
                                      @click="toShowCustomer(item.secondInsLasInfo.cardno)">{{item.secondInsLasInfo.cardno}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">职业:</label>
                              </el-col>
                              <el-col :span="14" class="div-txt">
																<span class="com-txt"
                                      :title="item.secondInsLasInfo.occpcden +' '+ item.secondInsLasInfo.doccdesco +' '+ item.secondInsLasInfo.occpLvl">{{item.secondInsLasInfo.occpcden}}
																	{{item.secondInsLasInfo.doccdesco}}
																	{{item.secondInsLasInfo.occpLvl}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">工作单位:</label>
                              </el-col>
                              <el-col :span="14" class="div-txt">
																<span class="com-txt"
                                      :title="item.secondInsLasInfo.workUnit">{{item.secondInsLasInfo.workUnit}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">出生日期:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.birthday}}</span>
                              </el-col>
                            </el-col>
                          </el-row>
                          <el-row class="mt10">
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">风险等级:</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.risklvl}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">身高(厘米):</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.height}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">体重(公斤):</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.weight}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">体格指数:</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.bmi}}</span>
                              </el-col>
                            </el-col>
                          </el-row>
                          <el-row class="mt10">
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">年龄:</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.age}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">有效期类型:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.cardflag}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">有效期起始日:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.dateup02}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">有效期截止日:</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.dateup}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">通讯地址:</label>
                              </el-col>
                              <el-col :span="14" class="div-txt">
																<span class="com-txt"
                                      :title="item.secondInsLasInfo.addr01">{{item.secondInsLasInfo.addr01}}</span>
                              </el-col>
                            </el-col>
                          </el-row>
                          <el-row class="mt10">
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">年收入(万元):</label>
                              </el-col>
                              <el-col :span="14">
                                <span class="com-txt">{{item.secondInsLasInfo.anne}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">手机:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.moblie01}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">单位电话:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.moblie03}}</span>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="10">
                                <label class="complain-lab">住宅电话:</label>
                              </el-col>
                              <el-col :span="14">
																<span
                                    class="com-txt">{{item.secondInsLasInfo.moblie02}}</span>
                              </el-col>
                            </el-col>
                          </el-row>
                          <el-row class="mt10">
                            <el-col :span="6">
                              <el-col :span="24">
                                <label class="com-txt-line"
                                       @click="showNameInfo(2,item)">被保人英文/拼音姓名</label>
                              </el-col>
                            </el-col>
                            <el-col :span="6">
                              <el-col :span="24">
                                <label class="com-txt-line"
                                       @click="showBaseInfo(2,item)">客户资料信息比对</label>
                              </el-col>

                            </el-col>
                          </el-row>
                        </el-tab-pane>
                        <el-tab-pane label="健康告知信息" name="second">
                          <el-table :data="item.secondInsHealthInfo">
                            <el-table-column type="index" label="序号" min-width="100"
                                             show-overflow-tooltip></el-table-column>
                            <el-table-column property="surname" label="姓名" min-width="50"
                                             show-overflow-tooltip></el-table-column>
                            <!--                                                        <el-table-column property="informno" label="代码" min-width="40" show-overflow-tooltip></el-table-column>-->
                            <el-table-column property="informdesc" label="题目"
                                             min-width="470" show-overflow-tooltip></el-table-column>
                            <el-table-column property="notedesc" label="说明" min-width="100"
                                             show-overflow-tooltip></el-table-column>
                          </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="智能核保结论及问答" name="third">
                          <el-table :data="item.secondInsAnswer">
                            <el-table-column type="index" label="题号" min-width="100"
                                             show-overflow-tooltip></el-table-column>
                            <el-table-column property="icdName" label="疾病名称" min-width="120"
                                             show-overflow-tooltip></el-table-column>
                            <el-table-column property="questionName" label="问题"
                                             min-width="120" show-overflow-tooltip></el-table-column>
                            <el-table-column property="answerContent" label="说明"
                                             min-width="300" show-overflow-tooltip></el-table-column>
                            <el-table-column property="conclusion" label="智能核结论"
                                             min-width="120" show-overflow-tooltip></el-table-column>
                          </el-table>
                        </el-tab-pane>
                      </el-tabs>
                    </el-tab-pane>
                    <!-- 第二被保人需求 end -->
										<el-tab-pane label="投保人信息" name="second">
											<!-- 投保人同被保人 -->
											<el-tabs v-model="activeName4" type="card" class="mt10">
												<el-tab-pane label="基本信息" name="first" class="person">
													<el-row>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">姓名:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.appLasInfo.name">{{item.appLasInfo.name}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">国籍:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.appLasInfo.ctrycode">{{item.appLasInfo.ctrycode}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">性别:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.sex}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">证件类型:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.idcardtype}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">证件号码:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt com-txt-line"
																	@click="toShowCustomer(item.appLasInfo.cardno)">{{item.appLasInfo.cardno}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">职业:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.appLasInfo.occpcden +' '+ item.appLasInfo.doccdesco +' '+ item.appLasInfo.occpLvl">{{item.appLasInfo.occpcden}}
																	{{item.appLasInfo.doccdesco}}
																	{{item.appLasInfo.occpLvl}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">工作单位:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.appLasInfo.workUnit">{{item.appLasInfo.workUnit}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">出生日期:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.birthday}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">风险等级:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.risklvl}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">身高(厘米):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.height}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">体重(公斤):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.weight}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">体格指数:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.bmi}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">年龄:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.age}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期类型:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.cardflag}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期起始日:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.dateup02}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">有效期截止日:</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.dateup}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">通讯地址:</label>
															</el-col>
															<el-col :span="14" class="div-txt">
																<span class="com-txt"
																	:title="item.appLasInfo.addr01">{{item.appLasInfo.addr01}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">年收入(万元):</label>
															</el-col>
															<el-col :span="14">
																<span class="com-txt">{{item.appLasInfo.anne}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">手机:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.moblie01}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">单位电话:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.moblie03}}</span>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="10">
																<label class="complain-lab">住宅电话:</label>
															</el-col>
															<el-col :span="14">
																<span
																	class="com-txt">{{item.appLasInfo.moblie02}}</span>
															</el-col>
														</el-col>
													</el-row>
													<el-row class="mt10">
														<el-col :span="6">
															<el-col :span="24">
																<label class="com-txt-line"
																	@click="showNameInfo(1,item)">投保人英文/拼音姓名</label>
															</el-col>
														</el-col>
														<el-col :span="6">
															<el-col :span="24">
																<label class="com-txt-line"
																	@click="showBaseInfo(1,item)">客户资料信息比对</label>
															</el-col>

														</el-col>
													</el-row>
												</el-tab-pane>
												<el-tab-pane label="健康告知信息" name="second">
													<el-table :data="item.appHealthInfo">
														<el-table-column type="index" label="序号" min-width="100"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="surname" label="姓名" min-width="50"
															show-overflow-tooltip></el-table-column>
														<!--                                                        <el-table-column property="informno" label="代码" min-width="40" show-overflow-tooltip></el-table-column>-->
														<el-table-column property="informdesc" label="题目"
															min-width="470" show-overflow-tooltip></el-table-column>
														<el-table-column property="notedesc" label="说明" min-width="100"
															show-overflow-tooltip></el-table-column>
													</el-table>
												</el-tab-pane>
												<el-tab-pane label="智能核保结论及问答" name="third">
													<el-table :data="item.appAnswer">
														<el-table-column type="index" label="题号" min-width="100"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="icdName" label="疾病名称" min-width="120"
															show-overflow-tooltip></el-table-column>
														<el-table-column property="questionName" label="问题"
															min-width="120" show-overflow-tooltip></el-table-column>
														<el-table-column property="answerContent" label="说明"
															min-width="300" show-overflow-tooltip></el-table-column>
														<el-table-column property="conclusion" label="智能核结论"
															min-width="120" show-overflow-tooltip></el-table-column>
													</el-table>
												</el-tab-pane>
											</el-tabs>
										</el-tab-pane>
									</el-tabs>
								</el-col>
								<!--投保计划信息-->
								<el-col :span="24" class="main-cell">
									<div class="main-cell-title">
										<span class="line">|</span>
										<span>投保计划</span>
										<span
											style="margin-left:6.125rem ;cursor: pointer;color: #68A3FC; text-decoration: underline;"
											@click="showImageList(item.euaa.applnum)">查看影像</span>
									</div>
									<el-col :span="24">
										<el-table :data="item.trailer4" :row-class-name="conclusionsClass"
											style="width: 100%">
											<el-table-column type="selection" min-width="20"></el-table-column>
											<el-table-column property="as_surname" label="被保险人" min-width="120"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="age" label="年龄" min-width="50"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="sex" label="性别" min-width="50"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="mortcls" label="职级" min-width="50"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="crtable" label="险种名称" min-width="120"
												show-overflow-tooltip>
												<template slot-scope="scope">
													<span :title="scope.row.tableDesc"> {{scope.row.polpln}}</span>
												</template>
											</el-table-column>
											<el-table-column property="sumins" label="保险金额" min-width="120"
												show-overflow-tooltip>
												<template slot-scope="scope">
													<span :title="scope.row.sumins">
														{{scope.row.sumins.toFixed(2)}}</span>
												</template>
											</el-table-column>
											<el-table-column property="riskCessTerm" label="保障期" min-width="80"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="premCessTerm" label="缴费期" min-width="80"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="zbinstprem" label="标准保费" min-width="120"
												show-overflow-tooltip>
												<template slot-scope="scope">
													<span :title="scope.row.zbinstprem">
														{{scope.row.zbinstprem.toFixed(2)}}</span>
												</template>
											</el-table-column>
											<el-table-column property="zlinstprem" label="加费金额" min-width="120"
												show-overflow-tooltip>
												<template slot-scope="scope">
													<span :title="scope.row.zlinstprem">
														{{scope.row.zlinstprem.toFixed(2)}}</span>
												</template>
											</el-table-column>
											<el-table-column property="maxsumin" label="最高保额" min-width="120"
												show-overflow-tooltip></el-table-column>
											<el-table-column property="approval" label="险种核保结论" min-width="120">
												<template slot-scope="scope">
													<div class="cuShow">
														<el-select placeholder="请选择" v-if="item.euaa.approval=='W'"
															v-model="scope.row.approval"
															:ref="'conclusions'+scope.row.index">
															<el-option v-for="con in catablesConclusions1"
																:key="con.value" :label="con.label" :value="con.value"
																:disabled="con.disabled">
															</el-option>
														</el-select>
														<el-select placeholder="请选择" v-else v-model="scope.row.approval"
															:ref="'conclusions'+scope.row.index">
															<el-option v-for="con in catablesConclusions"
																:key="con.value" :label="con.label" :value="con.value"
																@click.native="changeConclusions(item,scope.row)"
																:disabled="con.disabled">
															</el-option>
														</el-select>
														<!--                                                        <el-select v-else placeholder="请选择" class="sel-bgf3"-->
														<!--                                                                   disabled v-model="scope.row.approval">-->
														<!--                                                            <el-option-->
														<!--                                                                    v-for="con in catablesConclusions"-->
														<!--                                                                    :key="con.value"-->
														<!--                                                                    :label="con.label"-->
														<!--                                                                    :value="con.value"-->
														<!--                                                                    :disabled="con.disabled">-->
														<!--                                                            </el-option>-->
														<!--                                                        </el-select>-->
														<!--                                                <el-input v-model="scope.row.address1" readonly></el-input>-->
													</div>
												</template>
											</el-table-column>
										</el-table>
									</el-col>
									<el-col :span="24">
										<el-col :span="6" class="com-block">
											<span>保费合计:</span>
											<span class="com-price">￥{{item.instpremTotal.toFixed(2)}}</span>
										</el-col>
										<el-col :span="6" class="com-block">
											<span>首期保费合计:</span>
											<span class="com-price">￥{{item.firstpremTotal.toFixed(2)}}</span>
										</el-col>
										<el-col :span="12" class="com-block" v-if="curPageData.isContainRate =='1'">
											<el-col :span="10" class="common-lab">
												<label class="labelName">费率档次</label>
											</el-col>
											<el-col :span="10" class="com-select">
												<el-select v-if="item.allInfoReadOnly" class="sel-bgf3" disabled
													placeholder="请选择" v-model="item.insBaseInfo.flag03">
													<el-option v-for="item in flag03s" :key="item.value"
														:label="item.label" :value="item.value">
													</el-option>
												</el-select>
												<el-select v-else placeholder="请选择" v-model="flag03"
													@change="rateChanged($event,item)">
													<el-option v-for="item in flag03s" :key="item.value"
														:label="item.label" :value="item.value">
													</el-option>
												</el-select>
											</el-col>
											<el-col :span="20" style="opacity: 0.0;">.</el-col>
										</el-col>
										<el-col v-else :span="12" class="com-block">

										</el-col>
									</el-col>
									<el-col :span="24">
										<el-col :span="8">
											<button class="check-info mt10"
												@click="contentChange(item)">承保变更内容通知书预览</button>
											<button class="check-info mt10 ml10" @click="zaibao(item)">再保意见</button>
											<button class="check-info mt10 ml10"
												v-if="item.cancelApproval && !allInfoReadOnly"
												@click="cancelAppro(item)">撤销核保决定</button>
										</el-col>
									</el-col>
								</el-col>
								<!--照会信息-->
								<el-col :span="24" class="main-cell uwzh mt20">
									<div class="main-cell-title">
										<span class="line">|</span>
										<span>照会内容</span>
										<span
											style="margin-left:6.125rem ;cursor: pointer;color: #68A3FC; text-decoration: underline;"
											@click="showImageList(item.euaa.applnum)">查看影像</span>
									</div>
									<el-col :span="24">
										<el-table :data="item.eubas" :row-class-name="rowClassName" ref="multipleTable"
											@selection-change="handleSelectionChange" style="width:100%">

											<el-table-column type="selection" @click="selectInit(item,$event)">
											</el-table-column>

											<el-table-column property="clntnum" label="照会对象" min-width="140">
												<template slot-scope="scope">
													<el-select v-if="scope.row.clntnumSelectBg=='RB'" class="cell-bgb7"
														disabled placeholder="请选择" v-model="scope.row.clntnum">
														<el-option v-for="clnt in item.headClntnumList"
															:key="clnt.clntnum" :label="clnt.surname"
															:value="clnt.clntnum">
														</el-option>
													</el-select>
													<el-select v-else-if="scope.row.clntnumSelectBg=='B'"
														@change="changeClntnum(item,scope.row)" class="cell-bgb7"
														placeholder="请选择" v-model="scope.row.clntnum">
														<el-option v-for="clnt in item.headClntnumList"
															:key="clnt.clntnum" :label="clnt.surname"
															:value="clnt.clntnum">
														</el-option>
													</el-select>
													<el-select v-else placeholder="请选择" v-model="scope.row.clntnum"
														@change="changeClntnum(item,scope.row)">
														<el-option v-for="clnt in item.headClntnumList"
															:key="clnt.clntnum" :label="clnt.surname"
															:value="clnt.clntnum">
														</el-option>
													</el-select>
												</template>
											</el-table-column>
											<el-table-column property="pntype" label="照会类型" min-width="140">
												<template slot-scope="scope">
													<el-select placeholder="请选择"
														v-if="item.allInfoReadOnly || scope.row.isOld" disabled
														v-model="scope.row.pntype">
														<el-option v-for="item in eubaTypes" :key="item.value"
															:label="item.label" :value="item.value"
															:disabled="item.disabled">
														</el-option>
													</el-select>
													<el-select placeholder="请选择" v-else v-model="scope.row.pntype"
														@change="changePntype($event,item,scope.row)">
														<el-option v-for="item in eubaTypes" :key="item.value"
															:label="item.label" :value="item.value"
															:disabled="item.disabled">
														</el-option>
													</el-select>
												</template>
											</el-table-column>
											<el-table-column property="pncode" label="照会代码" min-width="80">
												<template slot-scope="scope">
													<div v-if="scope.row.pncodeBg == 'RB'" class="cell-bgb7">
														<el-input v-model="scope.row.pncode" disabled
															class="cur-pointer"></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'RR'" class="cell-bgred">
														<el-input v-model="scope.row.pncode" disabled></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'RF'" class="cell-bgf3">
														<el-input v-model="scope.row.pncode" disabled></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'RG'" class="cell-bgblue">
														<el-input v-model="scope.row.pncode" disabled></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'R'"
														@click="showPicList($event,scope.row.index,scope.row,item)"
														class="pic-select-mian cell-bgred"
														:ref="`picSelect${scope.row.index}`">
														<el-input @change="changePncode(item,scope.row)"
															v-on:input="layoutAutoComplate(scope.row)"
															v-model="scope.row.pncode" class="cur-pointer"></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'F'"
														@click="showPicList($event,scope.row.index,scope.row,item)"
														class="pic-select-mian cell-bgf3"
														:ref="`picSelect${scope.row.index}`">
														<el-input @change="changePncode(item,scope.row)"
															v-on:input="layoutAutoComplate(scope.row)"
															v-model="scope.row.pncode" class="cur-pointer"></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'G'"
														@click="showPicList($event,scope.row.index,scope.row,item)"
														class="pic-select-mian cell-bgblue"
														:ref="`picSelect${scope.row.index}`">
														<el-input @change="changePncode(item,scope.row)"
															v-on:input="layoutAutoComplate(scope.row)"
															v-model="scope.row.pncode" class="cur-pointer"></el-input>
													</div>
													<div v-else-if="scope.row.pncodeBg == 'B'"
														@click="showPicList($event,scope.row.index,scope.row,item)"
														class="pic-select-mian cell-bgb7"
														:ref="`picSelect${scope.row.index}`">
														<el-input @change="changePncode(item,scope.row)"
															v-on:input="layoutAutoComplate(scope.row)"
															v-model="scope.row.pncode" class="cur-pointer"></el-input>
													</div>
													<div v-else
														@click="showPicList($event,scope.row.index,scope.row,item)"
														class="pic-select-mian" :ref="`picSelect${scope.row.index}`">
														<el-input @change="changePncode(item,scope.row)"
															v-on:input="layoutAutoComplate(scope.row)"
															v-model="scope.row.pncode" class="cur-pointer"></el-input>
													</div>

												</template>
											</el-table-column>
											<el-table-column property="procflg" width="70" label="处理码">
												<template slot-scope="scope">

													<el-input v-if="scope.row.procflgBg == 'RB'"
														:ref="`procflg${scope.row.index}`"
														@change="changeProcflg(item,scope.row)" :maxlength="1"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgb7" readonly v-model="scope.row.procflg">
													</el-input>
													<el-input v-else-if="scope.row.procflgBg == 'RR'"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgred" readonly v-model="scope.row.procflg">
													</el-input>
													<el-input v-else-if="scope.row.procflgBg == 'RF'"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgf3" readonly v-model="scope.row.procflg">
													</el-input>
													<el-input v-else-if="scope.row.procflgBg == 'RG'" :maxlength="1"
														:ref="`procflg${scope.row.index}`"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgblue" readonly v-model="scope.row.procflg">
													</el-input>
													<el-input v-else-if="scope.row.procflgBg == 'R'"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgred" v-model="scope.row.procflg"></el-input>
													<el-input v-else-if="scope.row.procflgBg == 'F'" :maxlength="1"
														:ref="`procflg${scope.row.index}`"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgf3" v-model="scope.row.procflg"></el-input>
													<el-input v-else-if="scope.row.procflgBg == 'G'"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgblue" v-model="scope.row.procflg"></el-input>
													<el-input v-else-if="scope.row.procflgBg == 'B'"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"
														class="cell-bgb7" v-model="scope.row.procflg"></el-input>
													<el-input v-else v-model="scope.row.procflg"
														:ref="`procflg${scope.row.index}`" :maxlength="1"
														@change="changeProcflg(item,scope.row)"
														@keyup.up.native="procflgUpKey(item,scope.row)"
														@keyup.down.native="procflgDownKey(item,scope.row)"></el-input>
												</template>

											</el-table-column>
											<el-table-column property="pedesc" label="照会说明"  min-width="800">
												<template slot-scope="scope">
													<el-popover trigger="hover" width="350" placement="bottom-start"
														close-delay="0" :offset="100">
														<p class="desctips"> {{ scope.row.pedesc }}</p>
														<div slot="reference" class="name-wrapper">
															<el-input v-if="scope.row.pedescBg == 'RB'"
																class="cell-bgb7" readonly v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'RR'"
																class="cell-bgred" readonly v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'RF'"
																class="cell-bgf3" readonly v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'RG'"
																class="cell-bgblue" disabled v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'R'"
																class="cell-bgred" v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'F'"
																class="cell-bgf3" v-model="scope.row.pedesc"></el-input>
															<el-input v-else-if="scope.row.pedescBg == 'G'"
																class="cell-bgblue" v-model="scope.row.pedesc">
															</el-input>
															<el-input v-else-if="scope.row.pedescBg == 'B'"
																class="cell-bgb7" v-model="scope.row.pedesc"></el-input>
															<el-input v-else v-model="scope.row.pedesc"></el-input>
														</div>
													</el-popover>

												</template>
											</el-table-column>
											<el-table-column property="pndate" label="照会日期" min-width="100">
											</el-table-column>
											<el-table-column property="rprntdate" label="打印日期" min-width="100">
											</el-table-column>
											<el-table-column property="dateend" label="核销日期" min-width="100">
											</el-table-column>
											<el-table-column property="pnfrom" label="照会来源" min-width="150">
											</el-table-column>
											<el-table-column property="userid" label="核准人" min-width="150">
											</el-table-column>
										</el-table>
									</el-col>
									<el-col :span="24">
										<el-col :span="8" v-if="!item.allInfoReadOnly">
											<button class="check-info mt10" v-if="item.pnAddDis" disabled>新增</button>
											<button class="check-info mt10" v-else @click="addPn(item)">新增</button>
											<button class="check-info-def mt10 ml10" v-if="item.pnDelDis"
												disabled>删除</button>
											<button class="check-info-def mt10 ml10" v-else
												@click="delPn(item)">删除</button>
											<button class="check-info mt10 ml10"
												@click="showLigfeInv(item)">生存调查</button>
										</el-col>
										<el-col :span="8" v-else>
											<button class="check-info mt10 ml10"
												@click="showLigfeInv(item)">生存调查</button>
										</el-col>

										<el-col :span="8" class="mt10">
											<el-col :span="4">
												<label class="com-lab">核准</label>
											</el-col>
											<el-col :span="10" class="com-select">
												<el-select v-if="item.pnflag || item.allInfoReadOnly" class="sel-bgf3"
													disabled placeholder="请选择" v-model="item.appind">
													<el-option v-for="r in ratifies" :key="r.value" :label="r.label"
														:value="r.value">
													</el-option>
												</el-select>
												<el-select v-else placeholder="请选择" v-model="item.appind"
													@change="appindChanged(item)">
													<el-option v-for="(r,index) in ratifies" :key="index"
														:label="r.label" :value="r.value">
													</el-option>
												</el-select>
											</el-col>
											<el-col :span="6" style="margin-left: 0.825rem;">
												<el-button class="com-lab" @click="allEuabX(item)"
													v-if="item.eubas&&item.eubas.length > 0 ">一键核销照会</el-button>
											</el-col>
										</el-col>

                    <el-col :span="8" class="mt10">
											<label class="com-lab" style="color:#f86767;">AI核保结论：</label>
											<label style="color:#f86767;margin-right: 10px">{{medicals.length ? medicals[0].underwriting : ''}}</label>
                      <el-button class="check-info mt10" :disabled="!medicals.length" @click="AiDetail">查看详情</el-button>
										</el-col>
									</el-col>
								</el-col>
								<!--核保意见信息-->
								<el-col :span="24" class="main-cell mt20 ">
									<el-col :span="24">
										<div
											style="width:52.5rem;float: right;z-index: 2;position: relative;padding-top: 0.434rem;">
											<span
												style="cursor: pointer;color: rgb(104, 163, 252);text-decoration: underline;"
												@click="showImageList(item.euaa.applnum)">查看影像</span>
											<span style="margin-left:2.125rem;margin-right:2.125rem;">整单核保结论</span>
											<span style="width:15%;display:inline-block">
												<el-select @focus="conclusionShow(item)"
													v-if="(!isApprovalDisabled && !item.allInfoReadOnly)  || isTBSX"
													placeholder="请选择" v-model="item.euaa.approval">
													<el-option v-for="p in item.pConclusions" :key="p.value"
														:label="p.label" :value="p.value"
														@click.native="decideChanged(item)">
													</el-option>
												</el-select>
												<el-select v-else disabled placeholder="请选择"
													v-model="item.euaa.approval">
													<el-option v-for="p in item.pConclusions" :key="p.value"
														:label="p.label" :value="p.value">
													</el-option>
												</el-select>
											</span>
											<span style="margin-left: 2.125rem">
												<el-checkbox v-model="item.isSameToOtherPolicy"
													v-if="item.isSameToOther" disabled>
													本单核保结论适用于同时投保的其他保单
												</el-checkbox>
												<el-checkbox v-model="item.isSameToOtherPolicy"
													v-if="!item.isSameToOther" :disabled="item.allInfoReadOnly"
													@change="changeToOther(item)">本单核保结论适用于同时投保的其他保单
												</el-checkbox>
											</span>
										</div>
										<el-tabs v-model="activeName5" type="border-card" @tab-click="handletabsClick">
											<el-tab-pane label="核保意见" name='one' class="mt10">
												<el-table :data="item.trailer13" @row-click="showDesc(item,$event)"
													:row-class-name="tableRowClassName" :row-style="selectHeight">
													<el-table-column property="bmntdesc" label="核保意见"></el-table-column>
													<el-table-column width="150" property="effdate" label="日期">
													</el-table-column>
													<el-table-column width="150" property="userProfile" label="核保员">
													</el-table-column>
												</el-table>
												<el-row class="mt10">
													<el-col :span="8">
														<button class="check-info " v-if="!item.allInfoReadOnly"
															@click="addEucm(item)">新增</button>
														<button class="check-info  ml10" v-if="!item.allInfoReadOnly"
															@click="updateEucm(item)">更新</button>
														<button class="check-info-def  ml10"
															v-if="!item.allInfoReadOnly"
															@click="delEucm(item)">删除</button>
													</el-col>
												</el-row>
												<el-row class="mt10 editInput">
													<el-col :span="24">
														<el-input v-if="item.allInfoReadOnly" disabled type="textarea"
															:rows="10" v-model="bmntdesc" placeholder="请输入内容">
														</el-input>
														<el-input v-else type="textarea" :rows="10" v-model="bmntdesc"
															placeholder="请输入内容">
														</el-input>
													</el-col>
												</el-row>
											</el-tab-pane>
											<el-tab-pane label="复核意见" name='two' class="mt10">
												<el-table :data="item.cusfpky03List">
													<el-table-column type="index" label="序号" width="50">
													</el-table-column>
													<el-table-column property="note1" label="Note1" width="150"
														show-overflow-tooltip></el-table-column>
													<el-table-column property="remark01" label="类别" width="150"
														show-overflow-tooltip></el-table-column>
													<el-table-column property="notedesc" label="内容"
														show-overflow-tooltip></el-table-column>
													<el-table-column property="remark02" label="复核人员" width="120">
													</el-table-column>
													<el-table-column property="dateup" label="复核时间" width="120">
													</el-table-column>
												</el-table>
											</el-tab-pane>
											<el-tab-pane label="AI核保" name='three' class="mt10">
												<el-row class="mt10">
													<el-col :span="8">
														<!-- <button class="check-info " v-if="!item.allInfoReadOnly"
															@click="callAihebao()">发起AI核保</button> -->
														<el-button type="danger" plain class="ml10" :disabled="!checkList.length"
															@click="seeAiList()">查看AI详情</el-button>

                            <el-button type="danger" plain class="ml10" :disabled="!checkList.length"
															@click="recordAihebao()">手工补录</el-button>
													</el-col>
												</el-row>
												<el-table :data="medicals" style="width: 100%"
													@selection-change="handleSelectionChangeMedical">
													<!-- <el-table-column type="selection" width="55">
													</el-table-column> -->
                          <el-table-column align="center" width="55" label="选择">
                            <template slot-scope="scope">
                              <!-- 可以手动的修改label的值，从而控制选择哪一项 -->
                              <el-radio class="radio" v-model="templateSelection" :label="scope.row._id"
															@input="selectAiItem(scope.row)"
                                >&nbsp;</el-radio
                              >
                            </template>
                          </el-table-column>
													<el-table-column label="是否发起过AI">
														<template slot-scope="scope">
															<span v-if="scope.row.isAI == 1"
																style="color: red;">是</span>
															<span v-else>否</span>
														</template>
													</el-table-column>
													<el-table-column prop="chdrNum" label="保单号" min-width="100"
														show-overflow-tooltip>
													</el-table-column>
                          <el-table-column label="投/被保人" show-overflow-tooltip min-width="100">
														<template slot-scope="scope">
															<span v-if="scope.row.clientType == '1'">投保人</span>
															<span v-else-if="scope.row.clientType == '2'">被保人</span>
															<span v-else-if="scope.row.clientType == '3'">投保人、被保人</span>
														</template>
													</el-table-column>
													<el-table-column prop="imageType" label="单证名称" min-width="120"
														show-overflow-tooltip>
													</el-table-column>
													<el-table-column prop="recordTime" label="扫描日期" min-width="120"
														show-overflow-tooltip>
													</el-table-column>
													<el-table-column prop="peCode" label="体检任务号" min-width="140"
														show-overflow-tooltip>
														<!-- <template slot-scope="scope">
															{{scope.row.busiType | busiTypePipe}}
														</template> -->
													</el-table-column>
                          <el-table-column prop="underwriting" label="AI核保结论" min-width="100"
														show-overflow-tooltip>
													</el-table-column>
												</el-table>
											</el-tab-pane>
										</el-tabs>
									</el-col>
								</el-col>
							</div>
						</el-row>

					</el-row>
				</div>
			</div>

		</div>

		<!-- 弹框开始 -->

		<!-- 营销员信息 -->
		<el-dialog title="营销员信息" :visible.sync="opinionDialogVisible6" width="60%" :close-on-click-modal="false" center>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">营销员所属机构</label>
				</el-col>
				<el-col :span="18">
					<el-col :span="8">
						<el-input v-model="salesInfo.agntcoy" disabled></el-input>
					</el-col>
					<el-col :span="8">
						<el-input v-model="salesInfo.cntbranch" disabled></el-input>
					</el-col>
				</el-col>
			</el-row>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">营销员一</label>
				</el-col>
				<el-col :span="18">
					<el-col :span="8">
						<el-input v-model="salesInfo.zrsecno01" disabled></el-input>
					</el-col>
					<el-col :span="8">
						<el-input v-model="salesInfo.agntname01" disabled></el-input>
					</el-col>
					<el-col :span="8">
						<el-input v-model="salesInfo.agtydesc01" disabled></el-input>
					</el-col>
				</el-col>
			</el-row>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">营销员一等级</label>
				</el-col>
				<el-col :span="6">
					<el-input v-model="salesInfo.as_agentClass01" disabled></el-input>
				</el-col>
			</el-row>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">营销员二</label>
				</el-col>
				<el-col :span="18">
					<el-col :span="8">
						<el-input v-model="salesInfo.zrsecno02" disabled></el-input>
					</el-col>
					<el-col :span="8">
						<el-input v-model="salesInfo.agntname02" disabled></el-input>
					</el-col>
					<el-col :span="8">
						<el-input v-model="salesInfo.agtydesc02" disabled></el-input>
					</el-col>
				</el-col>
			</el-row>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">营销员二等级</label>
				</el-col>
				<el-col :span="6">
					<el-input v-model="salesInfo.agentClass02" disabled></el-input>
				</el-col>
			</el-row>
			<el-row class="mb10">
				<el-col :span="4">
					<label class="complain-lab">销售人员</label>
				</el-col>
				<el-col :span="6">
					<el-input v-model="salesInfo.saleman" disabled></el-input>
				</el-col>
			</el-row>
			<span slot="footer" class="dialog-footer">
				<el-button @click="opinionDialogVisible6 = false">返 回</el-button>
			</span>
		</el-dialog>

		<!-- 承保变更通知书预览 -->
		<el-dialog class="DialogLeft" title="承保变更通知书预览" :visible.sync="opinionDialogVisible7" width="60%" ref="print"
			:close-on-click-modal="false" center>

			<div id="changeNoteView" class="contain">
				<el-row class="note-main" style="text-align: left;">
					<el-col :span="24">
						<el-col :span="10" class="note-logo-con">
							<img :src="logo" alt="" class='note-logo'>
						</el-col>
						<el-col :span="14">
							<p class="tit">中信保诚人寿保险有限公司</p>
							<p class="tip">承保内容变更通知书</p>
							<el-row class="com-note">
								<el-col :span="12" class="com-txt">
									<el-col :span="10">
										<label class="lab">受理号码:</label>
									</el-col>
									<el-col :span="14">
										<span class="txt">{{changeNoteViewData.applnum}}</span>
									</el-col>
								</el-col>
								<el-col :span="12" class="com-txt">
									<el-col :span="10">
										<label class="lab">保单号码:</label>
									</el-col>
									<el-col :span="14">
										<span class="txt">{{changeNoteViewData.chdrnum}}</span>
									</el-col>
								</el-col>
							</el-row>
							<el-row class="com-note">
								<el-col :span="12" class="com-txt">
									<el-col :span="10">
										<label class="lab">投保人:</label>
									</el-col>
									<el-col :span="14">
										<span class="txt">{{changeNoteViewData.applName}}</span>
									</el-col>
								</el-col>
								<el-col :span="12" class="com-txt">
									<el-col :span="10">
										<label class="lab">被保险人:</label>
									</el-col>
									<el-col :span="14">
										<span class="txt">{{changeNoteViewData.insureName}}</span>
                    <span class="txt" v-if="changeNoteViewData.secondInsureName">、{{changeNoteViewData.secondInsureName}}</span>
									</el-col>
								</el-col>
							</el-row>
							<el-row class="com-note">
								<el-col :span="24" class="com-txt">
									<el-col :span="5">
										<label class="lab">营销员:</label>
									</el-col>
									<el-col :span="19">
										<span class="txt">{{changeNoteViewData.saleName}}
											{{changeNoteViewData.saleDept}}</span>
									</el-col>
								</el-col>
							</el-row>
							<el-row class="com-note">
								<el-col :span="24" class="com-txt">
									<el-col :span="5">
										<label class="lab">照会日期:</label>
									</el-col>
									<el-col :span="19">
										<span class="txt">{{changeNoteViewData.pnappdate}}</span>
									</el-col>
								</el-col>
							</el-row>
						</el-col>
					</el-col>
					<el-col :span="24" class="mt10">
						<p class='como-title'>尊敬的{{changeNoteViewData.applName}}先生/女士:</p>
						<p class="com-title-txt">谢谢您申请投保本公司保险，经详细审核后，由于：</p>
						<p class="com-title-txt" v-html="changeNoteViewData.reason"></p>
					</el-col>
					<el-col :span="24" class="mt30">
						<p class='como-title'>本公司将按以下条件承保:（缴费方式与主险一致/币值单位:人民币元）</p>
						<p class="com-title-txt" v-html="changeNoteViewData.content"></p>
					</el-col>
					<el-col :span="24" class="mt30">
						<p class="com-title-txt">
							<span>
								若您的投保计划中含有保费豁免类产品，以上承保内容变更可能影响其他保险费，请你特别留意。
							</span>若您同意接收上述内容，请签署此通知书。如上述变更内容涉及到保费变更，请补交追加之保费，并同意授权本公司
							从您指定的银行账户中扣除变更后的应缴保费。自您签署此通知书且本公司收到足额保费签发保险单后，保险合同成立。
							如{{changeNoteViewData.backDate}}前仍未收到您的回复，本公司将取消您本次的投保申请。
						</p>
						<p class="com-title-txt">并颂</p>
						<p class="como-title">时祺！</p>
					</el-col>
					<el-col :span="24">
						<p class="com-bom-txt">中信保诚人寿保险有限公司</p>
						<p class="com-bom-txt">营运运作中心契约管理处敬启</p>
						<p class="com-bom-txt">{{changeNoteViewData.today}}</p>
					</el-col>
					<el-col :span="24" class="mt20">
						<p class="com-center-tit">承保内容变更说明书</p>
						<ul class="com-center-list">
							<li>本人申明自投保书签单之日起至本通知书签署之日止无职业内容变化、健康状况变化（无任何身体状况变化，就诊记录或检查）</li>
							<li>本人同意贵公司上述通知书之内容变更，并作为保险合同组成部分。</li>
						</ul>
						<p class="com-center-bom">此致 中信保诚人寿保险有限公司</p>
					</el-col>
					<el-col :span="24">
						<p class="com-bom-txt">投保人签名:<span class="sign"></span></p>
						<p class="com-bom-txt">被保人签名:<span class="sign"></span></p>
            <p class="com-bom-txt" v-if="changeNoteViewData.secondInsureName">第二被保人签名:<span class="sign"></span></p>
						<p class="com-bom-txt">签署日期:<span class="si"></span>年<span class="si"></span>月<span
								class="si"></span>日</p>
					</el-col>

				</el-row>
			</div>

			<span slot="footer" class="dialog-footer">
				<el-button v-if="!isPrintBtn" type="primary" @click="printPn">打 印</el-button>
			</span>
		</el-dialog>


		<!-- 照会代码弹框 -->
		<div class="select-main" v-if="opinionDialogVisible8">
			<el-row>
				<el-col :span="16">
					<el-col :span="6">
						<label class="complain-lab">照会编码</label>
					</el-col>
					<el-col :span="6">
						<el-input v-model="paginations.pncode" placeholder="请输入" clearable></el-input>
					</el-col>
					<el-col :span="6">
						<label class="complain-lab">照会说明</label>
					</el-col>
					<el-col :span="6">
						<el-input v-model="paginations.pndesc" placeholder="请输入" clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="8" class="text_right">
					<el-button type="primary" icon="el-icon-search" @click="searchPncode"></el-button>
					<el-button type="primary" plain icon="el-icon-refresh" @click="refreshPncode"></el-button>
				</el-col>
			</el-row>
			<el-table :data="pnCodes" class="mt10" @row-click="showPncode">
				<el-table-column property="pncode" label="照会代码" width="150"></el-table-column>
				<el-table-column property="pedesc" label="照会说明">
					<template slot-scope="scope">
						<span :title="scope.row.pedesc">{{scope.row.pedesc}}</span>
					</template>
				</el-table-column>
			</el-table>
			<el-row>
				<el-col :span="24">
					<div class="pagination">
						<el-pagination background v-if='paginations.total > 0' :page-sizes="paginations.pageSizes"
							:page-size="paginations.pageSize" :layout="paginations.layout" :total="paginations.total"
							:current-page='paginations.pageIndex' @current-change='handleCurrentChange'
							@size-change='handleSizeChange'>
						</el-pagination>
					</div>
				</el-col>
			</el-row>
			<div class="back-con">
				<button @click="opinionDialogVisible8 = false">返 回</button>
			</div>
		</div>

		<!-- 拒保/延期/取消 -->
		<el-dialog title="拒保/延期/取消" :visible.sync="opinionDialogVisible9" width="60%" :before-close="resolveBack"
			:close-on-click-modal="false" center>
			<el-row>
				<el-col :span="24" class="mt10">
					<el-col :span="3">
						<label class="complain-lab">拒保延期原因</label>
					</el-col>
					<el-col :span="19">
						<el-input placeholder="请输入" :disabled="isRead" v-model="postilTempVO.notedesc" type="textarea"
							clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="24" class="text_left">
					<button class="check-info" v-if="!isRead" @click="addResolve">增加</button>
				</el-col>
			</el-row>
			<el-table :data="curResolveList" class="mt10" style="width: 100%">
				<el-table-column property="notecode" label="原因码" min-width="120">
					<template slot-scope="scope">
						<el-select v-if="isRead" v-model="scope.row.notecode" filterable class="cell-bgb7"
							placeholder="请选择" disabled>
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
						<el-select v-else-if="scope.row.notecodeBg=='B'" v-model="scope.row.notecode" filterable
							class="cell-bgb7" placeholder="请选择" @change="notecodeChange(scope.row)">
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
						<el-select v-else-if="scope.row.notecodeBg=='RB'" v-model="scope.row.notecode" disabled
							class="cell-bgb7" placeholder="请选择">
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
						<el-select v-else-if="scope.row.notecodeBg=='RF'" v-model="scope.row.notecode" disabled
							class="cell-bgf3" placeholder="请选择">
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
						<el-select v-else-if="scope.row.notecodeBg=='F'" v-model="scope.row.notecode" filterable
							class="cell-bgf3" placeholder="请选择" @change="notecodeChange(scope.row)">
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
						<el-select v-else v-model="scope.row.notecode" filterable class="cell-bgb7" placeholder="请选择"
							@change="notecodeChange(scope.row)">
							<el-option v-for="item in carepkyCodes" :key="item.noteitem" :label="item.note"
								:value="item.noteitem">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
				<!--                <el-table-column property="reasonType" label="原因类型" min-width="120" show-overflow-tooltip>-->
				<!--                    <template slot-scope="scope">-->
				<!--                        <el-select v-model="scope.row.reasonType" filterable class="cell-bgb7" :disabled="isRead"-->
				<!--                                   placeholder="请选择">-->
				<!--                            <el-option-->
				<!--                                    v-for="item in reasons"-->
				<!--                                    :key="item.value"-->
				<!--                                    :label="item.label"-->
				<!--                                    :value="item.value">-->
				<!--                            </el-option>-->
				<!--                        </el-select>-->
				<!--                    </template>-->

				<!--                </el-table-column>-->
				<el-table-column property="notedesc" label="原因" min-width="200">
					<template slot-scope="scope">
						<div v-if="isRead || isCancel">
							<el-input class="cell-bgb7" disabled v-model="scope.row.notedesc"></el-input>
						</div>
						<div v-else-if="scope.row.notedescBg == 'RB'">
							<el-input class="cell-bgb7" disabled v-model="scope.row.notedesc"></el-input>
						</div>
						<div v-else-if="scope.row.notedescBg == 'B'">
							<el-input class="cell-bgb7" v-model="scope.row.notedesc"></el-input>
						</div>
						<div v-else-if="scope.row.notedescBg == 'RF'">
							<el-input class="cell-bgf3" disabled v-model="scope.row.notedesc"></el-input>
						</div>
						<div v-else-if="scope.row.notedescBg == 'F'">
							<el-input class="cell-bgf3" v-model="scope.row.notedesc"></el-input>
						</div>
						<div v-else>
							<el-input v-model="scope.row.notedesc"></el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column property="name" label="操作" width="100">
					<template slot-scope="scope">
						<!-- <span @click="delResolve(scope.row)" style="cursor: pointer">删除</span> -->
						<span class="operationIcon" v-if="!isRead" @click="delResolve(scope.row)">
							<i class="el-icon-delete"></i>
						</span>
					</template>
				</el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!isRead" @click="saveResolve">保 存</el-button>
				<el-button @click="resolveBack">返 回</el-button>
			</span>
		</el-dialog>

		<!-- 除外 -->
		<el-dialog title="除外" :visible.sync="opinionDialogVisible10" width="60%" v-loading="cwLoading"
			element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
			element-loading-background="rgba(0, 0, 0, 0.8)" :before-close="postilBack" :close-on-click-modal="false"
			center>
			<el-row>
				<el-col :span="24">
					<el-col :span="12">
						<el-col :span="6">
							<label class="complain-lab">被保险人姓名</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="postilTempVO.surname" disabled></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="6">
							<label class="complain-lab">险种名称</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="postilTempVO.polpln" disabled></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10">
					<el-col :span="3">
						<label class="complain-lab">除外原因</label>
					</el-col>
					<el-col :span="19">
						<el-input placeholder="请输入" :disabled="isRead" v-model="postilTempVO.notedesc" type="textarea"
							clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10 text_left">
					<button class="check-info mt10" v-if="!isPostilAdd && !isRead" @click="addPostil">增加</button>
				</el-col>
			</el-row>
			<el-table :data="postilTempList" class="mt10" :row-class-name="exceptName" style="width: 100%">
				<el-table-column property="pncode" label="除外代码" min-width="50">
					<template slot-scope="scope">
						<div v-if="isRead">
							<el-input class="cell-bgb7" disabled v-model="scope.row.pncode"></el-input>
						</div>
						<div v-else-if="scope.row.pncodeBg == 'RB'">
							<el-input class="cell-bgb7" disabled v-model="scope.row.pncode"></el-input>
						</div>
						<div v-else-if="scope.row.pncodeBg == 'B'" @click="showExcept($event,scope.row.index)"
							:ref="`excSelect${scope.row.index}`">
							<el-input class="cell-bgb7" v-on:input="layoutAutoComplate1(scope.row)"
								v-model="scope.row.pncode" @change="postilItemchanged(scope.row)"></el-input>
						</div>
						<div v-else-if="scope.row.pncodeBg == 'RF'">
							<el-input class="cell-bgf3" disabled v-model="scope.row.pncode"></el-input>
						</div>
						<div v-else-if="scope.row.pncodeBg == 'F'" @click="showExcept($event,scope.row.index)"
							:ref="`excSelect${scope.row.index}`">
							<el-input class="cell-bgf3" v-on:input="layoutAutoComplate1(scope.row)"
								v-model="scope.row.pncode" @change="postilItemchanged(scope.row)"></el-input>
						</div>
						<div v-else @click="showExcept($event,scope.row.index)" :ref="`excSelect${scope.row.index}`">
							<el-input v-on:input="layoutAutoComplate1(scope.row)" v-model="scope.row.pncode"
								@change="postilItemchanged(scope.row)"></el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column property="pedesc" label="除外内容" min-width="300">
					<template slot-scope="scope">
						<el-input v-if="isRead" class="cell-bgb7" disabled v-model="scope.row.pedesc"></el-input>
						<el-input v-else-if="scope.row.pedescBg == 'RB'" class="cell-bgb7" disabled
							v-model="scope.row.pedesc"></el-input>
						<el-input v-else-if="scope.row.pedescBg == 'B'" class="cell-bgb7" v-model="scope.row.pedesc">
						</el-input>
						<el-input v-else-if="scope.row.pedescBg == 'RF'" class="cell-bgf3" disabled
							v-model="scope.row.pedesc"></el-input>
						<el-input v-else-if="scope.row.pedescBg == 'F'" class="cell-bgf3" v-model="scope.row.pedesc">
						</el-input>
						<el-input v-else v-model="scope.row.pedesc"></el-input>
					</template>
				</el-table-column>
				<el-table-column property="name" label="操作" v-if="!isPostilDel && !isRead" width="50">
					<template slot-scope="scope">
						<!-- <span @click="delPostil(scope.row)" style="cursor: pointer">删除</span> -->
						<span class="operationIcon" @click="delPostil(scope.row)">
							<i class="el-icon-delete"></i>
						</span>
					</template>
				</el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!isRead" @click="savePostil(1)">确 定</el-button>
				<el-button @click="postilBack">返 回</el-button>
			</span>
		</el-dialog>


		<!-- 点击除外代码弹框 -->
		<div class="except-main" v-if="opinionDialogVisible15" style="width:60% !important;" v-loading="tbloading">
			<el-row>
				<el-col :span="16">
					<el-col :span="4">
						<label class="complain-lab">照会说明</label>
					</el-col>
					<el-col :span="16">
						<el-input v-model="paginations.pndesc" placeholder="请输入" clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="8">
					<el-button type="primary" icon="el-icon-search" @click="searchPncode"></el-button>
					<el-button type="primary" plain icon="el-icon-refresh" @click="refreshPncode"></el-button>
				</el-col>
			</el-row>
			<el-row>
				<el-table :data="pnCodes" class="mt20" @row-click="showPncode1">
					<el-table-column property="pncode" label="照会代码" width="120">
						<template slot-scope="scope">
							<div>
								{{scope.row.pncode}}
							</div>
						</template>
					</el-table-column>
					<el-table-column property="pedesc" label="照会说明">
						<template slot-scope="scope">
							<div>
								{{scope.row.pedesc}}
							</div>
						</template>
					</el-table-column>
				</el-table>
			</el-row>
			<el-row>
				<el-col :span="24">
					<div class="pagination">
						<el-pagination background v-if='paginations.total > 0' :page-sizes="paginations.pageSizes"
							:page-size="paginations.pageSize" :layout="paginations.layout" :total="paginations.total"
							:current-page='paginations.pageIndex' @current-change='handleCurrentChange'
							@size-change='handleSizeChange'>
						</el-pagination>
					</div>
				</el-col>
			</el-row>
			<div class="back-con mt10">
				<button @click="opinionDialogVisible15 = false">返 回</button>
			</div>
		</div>

		<!-- 加费 -->
		<el-dialog title="加费" :visible.sync="opinionDialogVisible14" width="60%" v-loading="apLoading"
			element-loading-text="拼命加载中..." element-loading-spinner="el-icon-loading" :before-close="premBack"
			:close-on-click-modal="false" center>
			<el-row>
				<el-col :span="24">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">被保险人姓名</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.surname" disabled></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">险种名称</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.polpln" disabled></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10">
					<el-col :span="4">
						<label class="complain-lab">加费原因</label>
					</el-col>
					<el-col :span="19">
						<el-input placeholder="请输入" :disabled="isRead" class="cell-bgf3"
							v-model="premiumTempVO.notedesc" type="textarea" clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="24" v-if="!isHiTr" class="mt10">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">HI加费</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.phi" :disabled="isRead"
								@blur="premiumItemchanged(premiumTempVO)" clearable></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">WP加费</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.pwp" :disabled="isRead"
								@blur="premiumItemchanged(premiumTempVO)" clearable></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="24" v-if="!isPrtTr" class="mt10">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">加权加费值</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.prt" disabled></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10 text_left">
					<button class="check-info mt10 ml20" v-if="!isPremiumAdd && !isRead" @click="addClick">增加</button>
					<!--                     <button class="check-info mt10 ml20" v-if="!specialPre" @click="preClick" >特殊加费处理</button>-->
				</el-col>
			</el-row>
			<el-row id="jf">
				<el-col :span="24">
					<el-table :data="premiumTempList" class="mt10" style="width: 100%">
						<el-table-column property="date" label="加费类别">
							<template slot-scope="scope">
								<el-select class="cell-bgb7" v-if="isRead" placeholder="请选择" v-model="scope.row.opcda"
									disabled>
									<el-option v-for="con in opcdaSelect" :key="con.value" :label="con.label"
										:value="con.value">
									</el-option>
								</el-select>
								<el-select class="cell-bgb7" v-else placeholder="请选择" v-model="scope.row.opcda"
									@change="opcdaChange(scope.row)">
									<el-option v-for="con in opcdaSelect" :key="con.value" :label="con.label"
										:value="con.value">
									</el-option>
								</el-select>
							</template>
						</el-table-column>
						<el-table-column property="extCessTerm" label="年期">
							<template slot-scope="scope">
								<el-input @change="ext_cess_termChange(scope.row)" :disabled="isRead" class="cell-bgb7"
									v-model="scope.row.extCessTerm"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="insprm" label="每十万保额加费">
							<template slot-scope="scope">
								<el-input @change="insprmChange(scope.row)" :disabled="isRead" class="cell-bgb7"
									v-model="scope.row.insprm"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="oppc" label="加费百分比">
							<template slot-scope="scope">
								<el-input v-if="isRead" class="cell-bgb7" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'RB'" @change="oppcChange(scope.row)"
									class="cell-bgb7" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'B'" @change="oppcChange(scope.row)"
									class="cell-bgb7" v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'RF'" @change="oppcChange(scope.row)"
									class="cell-bgf3" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'F'" @change="oppcChange(scope.row)"
									class="cell-bgf3" v-model="scope.row.oppc"></el-input>
								<el-input v-else @change="oppcChange(scope.row)" v-model="scope.row.oppc"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="zmortpct" label="TM">
							<template slot-scope="scope">
								<el-input v-if="isRead" class="cell-bgb7" disabled v-model="scope.row.zmortpct">
								</el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'RB'" @change="zmortpctChange(scope.row)"
									class="cell-bgb7" disabled v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'B'" @change="zmortpctChange(scope.row)"
									class="cell-bgb7" v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'RF'" @change="zmortpctChange(scope.row)"
									class="cell-bgf3" disabled v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'F'" @change="zmortpctChange(scope.row)"
									class="cell-bgf3" v-model="scope.row.zmortpct"></el-input>
								<el-input v-else @change="zmortpctChange(scope.row)" v-model="scope.row.zmortpct">
								</el-input>
							</template>
						</el-table-column>
						<el-table-column property="zlinstprem" label="次标加费"></el-table-column>
						<el-table-column property="name" label="操作" v-if="!isPremiumDel && !isRead">
							<template slot-scope="scope">
								<!-- <span @click="delClick(scope.row)" style="cursor: pointer">删除</span> -->
								<span class="operationIcon" @click="delClick(scope.row)">
									<i class="el-icon-delete"></i>
								</span>
								<span class="operationIcon" v-if="!specialPre" @click="preClick(scope.row)">
									<i class="el-icon-edit" title="特殊加费处理"></i>
								</span>
							</template>
						</el-table-column>
					</el-table>
				</el-col>
				<el-col :span="24">

					<el-col :span="24" class="com-block" style="text-align: right">
						<span>总加费金额:</span>
						<span class="com-price">￥{{curAddPremData.addSumins}}</span>
					</el-col>
				</el-col>
			</el-row>

			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!isPremiumCalc && !isRead" @click="calcClick('rate',1)">试算</el-button>
				<el-button type="primary" v-if="!isRead" @click="addPremSure('1')">确 定</el-button>
			</span>
		</el-dialog>


		<!-- 显示投保人英文/拼音姓名 -->
		<el-dialog :title="pyTitle" v-loading="susrgLoading" :visible.sync="opinionDialogVisible11" width="60%"
			:close-on-click-modal="false" center>
			<el-row>
				<el-col :span="12">
					<el-col :span="10">
						<label class="complain-lab">姓（中文或英文）</label>
					</el-col>
					<el-col :span="14">
						<el-input placeholder="请输入" :disabled="allInfoReadOnly" v-model="euhm.susrname"></el-input>
					</el-col>
				</el-col>
				<el-col :span="12">
					<el-col :span="10">
						<label class="complain-lab">名（中文或英文）</label>
					</el-col>
					<el-col :span="14">
						<el-input placeholder="请输入" :disabled="allInfoReadOnly" v-model="euhm.susrgname"></el-input>
					</el-col>
				</el-col>
			</el-row>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!allInfoReadOnly" @click="saveClient">保 存</el-button>
				<el-button @click="opinionDialogVisible11 = false">返 回</el-button>
			</span>
		</el-dialog>

		<!-- 客户资料对比 -->
		<el-dialog title="客户资料对比" :visible.sync="opinionDialogVisible12" width="80%" :close-on-click-modal="false"
			center>
			<el-row>
				<el-table :data="cusInfo" class="mt10" style="width: 100%">
					<el-table-column property="name" min-width="120" show-overflow-tooltip></el-table-column>
					<el-table-column property="base" label="原始数据" min-width="200" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="las" label="LAS数据" min-width="200" show-overflow-tooltip>
					</el-table-column>
				</el-table>
			</el-row>
			<span slot="footer" class="dialog-footer">
				<!--            <el-button type="primary"  @click="opinionDialogVisible12 = false">保 存</el-button>-->
				<el-button @click="opinionDialogVisible12 = false">返 回</el-button>
			</span>
		</el-dialog>

		<!-- 反欺诈 -->
		<el-dialog title="反欺诈信息" :visible.sync="opinionDialogVisible13" width="60%" :close-on-click-modal="false"
			center>
			<el-row>
				<el-table :data="antis" class="mt10" style="width: 100%">
					<el-table-column property="fieldType" label="欺诈对象" min-width="120" show-overflow-tooltip>
						<template slot-scope="scope">
							{{scope.row.fieldType | fieldTypePipe}}
						</template>
					</el-table-column>
					<el-table-column property="ctar" label="姓名/单位名称" min-width="120" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="roleflag" label="证件类型" min-width="120" show-overflow-tooltip>
						<template slot-scope="scope">
							{{scope.row.roleflag | cerityPipe}}
						</template>
					</el-table-column>
					<el-table-column property="secuityno" label="证件号码" min-width="120" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="cltsex" label="性别" min-width="80" show-overflow-tooltip>
						<template slot-scope="scope">
							{{scope.row.cltsex | cltsexPipe}}
						</template>
					</el-table-column>
					<el-table-column property="cltdob" label="出生日期" min-width="160" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="appname" label="业务受理号" min-width="120" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="cltype" label="客户类型" min-width="120" show-overflow-tooltip>
						<template slot-scope="scope">
							{{scope.row.cltype | cltypePipe}}
						</template>
					</el-table-column>
					<el-table-column property="risklvl" label="欺诈风险事件级别" min-width="120" show-overflow-tooltip>
						<template slot-scope="scope">
							{{scope.row.risklvl | risklvlPipe}}
						</template>
					</el-table-column>
					<el-table-column property="famt01" label="欺诈涉及金额(元)" min-width="120" show-overflow-tooltip>
					</el-table-column>
					<el-table-column property="lapdate" label="业务拦截期限" min-width="120" show-overflow-tooltip>
					</el-table-column>
				</el-table>
			</el-row>
			<span slot="footer" class="dialog-footer">
				<el-button @click="opinionDialogVisible13 = false">返 回</el-button>
			</span>
		</el-dialog>


		<!--影像列表-->
		<cdfs-image-list :drawer="showImageFlag" :applnum="showImageApplnum" :docType="docType" @close="hideImageList">
		</cdfs-image-list>
		<!--加费除外-->
		<el-dialog title="加费除外" :visible.sync="ppFlag" width="60%" v-loading="apLoading" element-loading-text="拼命加载中..."
			element-loading-spinner="el-icon-loading" :before-close="ppBack" :close-on-click-modal="false" center>
			<el-row>
				<el-col :span="24">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">被保险人姓名</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.surname" disabled></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">险种名称</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.polpln" disabled></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10">
					<el-col :span="4">
						<label class="complain-lab">加费原因</label>
					</el-col>
					<el-col :span="19">
						<el-input placeholder="请输入" class="cell-bgf3" :disabled="isRead"
							v-model="premiumTempVO.notedesc" type="textarea" clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="24" class="mt10">
					<el-col :span="4">
						<label class="complain-lab">除外原因</label>
					</el-col>
					<el-col :span="19">
						<el-input placeholder="请输入" v-model="postilTempVO.notedesc" :disabled="isRead" type="textarea"
							clearable></el-input>
					</el-col>
				</el-col>
				<el-col :span="24" v-if="!isHiTr" class="mt10">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">HI加费</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.phi" :disabled="isRead"
								@blur="premiumItemchanged(spremiumTempVO)" clearable></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">WP加费</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.pwp" :disabled="isRead"
								@blur="premiumItemchanged(premiumTempVO)" clearable></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="24" v-if="!isPrtTr" class="mt10">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">加权加费值</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="premiumTempVO.prt" disabled></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
					</el-col>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">加费列表</el-col>
				<el-col :span="24" class="mt10 text_left">
					<button class="check-info mt10" v-if="!isPremiumCalc && !isRead"
						@click="calcClick('rate',2)">试算</button>
					<button class="check-info mt10 ml20" v-if="!isPremiumAdd && !isRead" @click="addClick">增加</button>
				</el-col>
			</el-row>
			<el-row id="jf">
				<el-col :span="24">
					<el-table :data="premiumTempList" class="mt10" style="width: 100%">
						<el-table-column property="date" label="加费类别">
							<template slot-scope="scope">
								<el-select class="cell-bgb7" placeholder="请选择" v-model="scope.row.opcda"
									:disabled="isRead" @change="opcdaChange(scope.row)">
									<el-option v-for="con in opcdaSelect" :key="con.value" :label="con.label"
										:value="con.value">
									</el-option>
								</el-select>
							</template>
						</el-table-column>
						<el-table-column property="extCessTerm" label="年期">
							<template slot-scope="scope">
								<el-input @change="ext_cess_termChange(scope.row)" :disabled="isRead" class="cell-bgb7"
									v-model="scope.row.extCessTerm"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="insprm" label="每十万保额加费">
							<template slot-scope="scope">
								<el-input @change="insprmChange(scope.row)" :disabled="isRead" class="cell-bgb7"
									v-model="scope.row.insprm"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="oppc" label="加费百分比">
							<template slot-scope="scope">
								<el-input v-if="isRead" class="cell-bgb7" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'RB'" @change="oppcChange(scope.row)"
									class="cell-bgb7" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'B'" @change="oppcChange(scope.row)"
									class="cell-bgb7" v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'RF'" @change="oppcChange(scope.row)"
									class="cell-bgf3" disabled v-model="scope.row.oppc"></el-input>
								<el-input v-else-if="scope.row.oppcBg == 'F'" @change="oppcChange(scope.row)"
									class="cell-bgf3" v-model="scope.row.oppc"></el-input>
								<el-input v-else @change="oppcChange(scope.row)" v-model="scope.row.oppc"></el-input>
							</template>
						</el-table-column>
						<el-table-column property="zmortpct" label="TM">
							<template slot-scope="scope">
								<el-input v-if="isRead" class="cell-bgb7" disabled v-model="scope.row.zmortpct">
								</el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'RB'" @change="zmortpctChange(scope.row)"
									class="cell-bgb7" disabled v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'B'" @change="zmortpctChange(scope.row)"
									class="cell-bgb7" v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'RF'" @change="zmortpctChange(scope.row)"
									class="cell-bgf3" disabled v-model="scope.row.zmortpct"></el-input>
								<el-input v-else-if="scope.row.zmortpctBg == 'F'" @change="zmortpctChange(scope.row)"
									class="cell-bgf3" v-model="scope.row.zmortpct"></el-input>
								<el-input v-else @change="zmortpctChange(scope.row)" v-model="scope.row.zmortpct">
								</el-input>
							</template>
						</el-table-column>
						<el-table-column property="zlinstprem" label="次标加费"></el-table-column>
						<el-table-column property="name" label="操作" v-if="!isPremiumDel && !isRead">
							<template slot-scope="scope">
								<!-- <span @click="delClick(scope.row)" style="cursor: pointer">删除</span> -->
								<span class="operationIcon" @click="delClick1(scope.row)">
									<i class="el-icon-delete"></i>
								</span>
								<span class="operationIcon" v-if="!specialPre" @click="preClick(scope.row)">
									<i class="el-icon-edit" title="特殊加费处理"></i>
								</span>
							</template>
						</el-table-column>
					</el-table>
				</el-col>
				<el-col :span="24">

					<el-col :span="24" class="com-block" style="text-align: right">
						<span>总加费金额:</span>
						<span class="com-price">￥{{curAddPremData.addSumins}}</span>
					</el-col>
				</el-col>
			</el-row>

			<el-row>
				<el-col :span="24">除外列表</el-col>
				<el-col :span="24" class="mt10 text_left">
					<button class="check-info mt10" v-if="!isPostilAdd && !isRead" @click="addPostil">增加</button>
				</el-col>
			</el-row>
			<el-row>
				<el-table :data="postilTempList" class="mt10" :row-class-name="exceptName1" style="width: 100%">
					<el-table-column property="pncode" label="除外代码" min-width="120" show-overflow-tooltip>
						<template slot-scope="scope">
							<div v-if="scope.row.pncodeBg == 'RB'">
								<el-input class="cell-bgb7" disabled v-model="scope.row.pncode"></el-input>
							</div>
							<div v-else-if="scope.row.pncodeBg == 'B'" @click="showExcept1($event,scope.row.index)"
								:ref="`excSelect1${scope.row.index}`">
								<el-input class="cell-bgb7" v-on:input="layoutAutoComplate1(scope.row)"
									v-model="scope.row.pncode" @change="postilItemchanged(scope.row)"></el-input>
							</div>
							<div v-else-if="scope.row.pncodeBg == 'RF'">
								<el-input class="cell-bgf3" disabled v-model="scope.row.pncode"></el-input>
							</div>
							<div v-else-if="scope.row.pncodeBg == 'F'" @click="showExcept1($event,scope.row.index)"
								:ref="`excSelect1${scope.row.index}`">
								<el-input class="cell-bgf3" v-on:input="layoutAutoComplate1(scope.row)"
									v-model="scope.row.pncode" @change="postilItemchanged(scope.row)"></el-input>
							</div>
							<div v-else @click="showExcept1($event,scope.row.index)"
								:ref="`excSelect1${scope.row.index}`">
								<el-input v-on:input="layoutAutoComplate1(scope.row)" v-model="scope.row.pncode"
									@change="postilItemchanged(scope.row)"></el-input>
							</div>
						</template>
					</el-table-column>
					<el-table-column property="pedesc" label="除外内容" min-width="200" show-overflow-tooltip>
						<template slot-scope="scope">
							<el-input v-if="scope.row.pedescBg == 'RB'" class="cell-bgb7" disabled
								v-model="scope.row.pedesc"></el-input>
							<el-input v-else-if="scope.row.pedescBg == 'B'" class="cell-bgb7"
								v-model="scope.row.pedesc"></el-input>
							<el-input v-else-if="scope.row.pedescBg == 'RF'" class="cell-bgf3" disabled
								v-model="scope.row.pedesc"></el-input>
							<el-input v-else-if="scope.row.pedescBg == 'F'" class="cell-bgf3"
								v-model="scope.row.pedesc"></el-input>
							<el-input v-else v-model="scope.row.pedesc"></el-input>
						</template>
					</el-table-column>
					<el-table-column property="name" label="操作" v-if="!isPostilDel" width="100">
						<template slot-scope="scope">
							<span class="operationIcon" @click="delPostil(scope.row)">
								<i class="el-icon-delete"></i>
							</span>
						</template>
					</el-table-column>
				</el-table>
			</el-row>

			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!isRead" @click="ppSave">确 定</el-button>
				<!-- <el-button @click="ppBack">返 回</el-button> -->
			</span>
		</el-dialog>

		<!-- 特殊加费试算 -->
		<el-dialog title="特殊加费试算" :visible.sync="preCalFlag" width="60%" v-loading="apLoading"
			element-loading-text="拼命加载中..." element-loading-spinner="el-icon-loading" :close-on-click-modal="false"
			center>
			<el-row>
				<el-col :span="24">
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">WP</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="wpNum" @blur="checkNum(wpNum)"
								@keyup="keyNumPress(wpNum)"></el-input>
						</el-col>
					</el-col>
					<el-col :span="12">
						<el-col :span="8">
							<label class="complain-lab">PB</label>
						</el-col>
						<el-col :span="14">
							<el-input placeholder="请输入" v-model="pbNum" @blur="checkNum(pbNum)"
								@keyup="keyNumPress(pbNum)"></el-input>
						</el-col>
					</el-col>
				</el-col>
				<el-col :span="12" class="mt10">
					<el-col :span="8">
						<label class="complain-lab">计算结果</label>
					</el-col>
					<el-col :span="14">
						<el-input placeholder="请输入" :disabled="isRead" class="cell-bgf3" v-model="resultNum" clearable>
						</el-input>
					</el-col>
				</el-col>
			</el-row>


			<span slot="footer" class="dialog-footer">
				<el-button type="primary" v-if="!isRead" @click="preCal">试算</el-button>
				<el-button @click="preBack">返 回</el-button>
			</span>
		</el-dialog>

		<!-- AI核保查看详情弹框 -->
		<el-dialog class="aihebao" title="核保查看详情" :visible.sync="aihebaoFlag" top="5vh" width="60%" v-loading="apLoading"
			element-loading-text="拼命加载中..." element-loading-spinner="el-icon-loading" :close-on-click-modal="false"
			center>
			<el-row>
				<el-table ref="aihebaotable" v-loading="aiLoading" :data="aihebaolistData" highlight-current-row height="58vh"
					header-cell-class-name="table-header-class" style="width:100%">
					<el-table-column min-width="80" property="chdrNum" label="保单号" align='center' show-overflow-tooltip>
					</el-table-column>
					<el-table-column min-width="120" property="underwritingFlow" label="流水号" align='center'
						show-overflow-tooltip>
					</el-table-column>
					<el-table-column min-width="100" property="userId" label="操作人" align='center'
						show-overflow-tooltip>
					</el-table-column>
					<el-table-column min-width="120" property="recordTime" label="发起时间" align='center'
						show-overflow-tooltip>
					</el-table-column>
					<el-table-column min-width="120" property="taskStatus" label="任务状态" align='center'
						show-overflow-tooltip>
						<template slot-scope="scope">
              {{ scope.row.taskStatus | formatDict(statusDic,'remark')}}
							<!-- {{scope.row.taskStatus | aiTaskstatusNewPipe}} -->
						</template>
					</el-table-column>
					<el-table-column min-width="120" property="taskStatus" label="查看核保详情" align='center'
						show-overflow-tooltip>
						<template slot-scope="scope">
							<el-button v-if="scope.row.taskStatus == '4'" @click="seeDetail(scope.row)"> 查看
							</el-button>
						</template>
					</el-table-column>
				</el-table>
			</el-row>
      <el-row>
				<el-col :span="24">
					<div class="pagination">
						<el-pagination background v-if='aiPages.total > 0' :page-sizes="aiPages.pageSizes"
							:page-size="aiPages.pageSize" :layout="aiPages.layout" :total="aiPages.total"
							:current-page='aiPages.pageIndex' @current-change='aiCurrentChange'
							@size-change='aiSizeChange'>
						</el-pagination>
					</div>
				</el-col>
			</el-row>
			<span slot="footer" class="dialog-footer">

				<el-button @click="aihebaoFlag =!aihebaoFlag">返 回</el-button>
			</span>
		</el-dialog>

		<!--慕再风险筛查-->
		<mz-record :drawer="showMzFlag" :item="mzObj" @close="hideMzList"></mz-record>
		<!--慕再风险筛查-->

		<!--瑞再风险筛查-->
		<rz-record :drawer="showPvFlag" :item="pvObj" @close="hidePvList"></rz-record>
		<!--瑞再风险筛查-->
	</div>
</template>
<script>
	import {
		getListNotepadIcd
	} from "@/api/customermanage/customerManage.js";
	import img1 from '@/assets/img/p1.png';
	import logo from '@/assets/img/Logo_mianxx.png';
	import {
		initPage,
		doubleClick,
		initWfOther,
		claimHistory,
		claimCount,
		findExamReport,
		findHealthReport,
		customerPolicyNos,
		findPos,
		queryCarepky,
		findCustomerComplaints,
		showYwpyxm,
		findPageByDimSelect,
		checkPncodeAndZresnpdFromEufapky,
		countEuhcByPncodeAndFlag01,
		deteRoll,
		callEuis020,
		callEuis006,
		showPostil,
		savePostilHead,
		savePostil,
		findPostilListWithTrailer1,
		saveEuhmpfBySerno,
		initHistory,
		getChdrnumByClntnum,
		findPolicyByApplnum,
		preQueryListByIdNum,
		findSernoByApplnum,
		getLevel,
		checkWDfor400,
		initIdwGDVOList,
		checkBank,
		findPersonHealths,
		fGetTotallist,
		getEufflvlvoListByUwlevel,
		calRiskSuminsForJsp,
		findPolplnByApplnum,
		callAihebao,
		seeAiList,
		queryChooseSize,
		initAmount,
		findPersonsInfo,
		getRandomStr,
    getAiTaskApi,
    getAiTaskRecordApi,
		repairAiTask
	} from "@/api/underwriting/uw";
	import {
		findContiNucleNoteHistory
	} from "@/api/underwriting/renewal";
	import {
		listNotepad
	} from "@/api/underwriting/notepad";
	import constant from '@/utils/constant';
	import uwconstant from '@/utils/uwConstants';
	import uwJs from '@/utils/effect';
	import uwLoadJs from '@/utils/uwLoad';
	import appName from '@/api/appName';
	import {
		procflgPige,
		billfreqPige,
		mmflgPige,
		cltsexPipe,
		fieldTypePipe,
		cerityPipe,
		cltypePipe,
		risklvlPipe,
		busiTypePipe,
		aiTaskstatusPipe,
    aiTaskstatusNewPipe
	} from '@/pipe/comPipe';
	import InsuranceRecords from '@/page/underwriting/underwritingManage/insuranceRecords';
	import suspendNav from '@/page/underwriting/underwritingManage/suspendNav';
	import customerComplaint from '@/page/underwriting/underwritingManage/customerComplaint';
	import accumulatedPremium from './accumulatedPremium';
	import claimsRecords from './claimsRecords';
	import pres from './pres';
	import keepRecord from './keepRecord';
	import abnormalTold from './abnormalTold';
	import supplementaryTold from './supplementaryTold';
	import medicalReport from './medicalReport';
	import notepad from './notepad';
	import identityCard from './identityCard';
	import reviewOpinion from './reviewOpinion';
	import customerInfo from './customerInfo';
	import consignor from './consignor';
	import {
		getToken,
		setCookie
	} from '@/utils/auth';
	import {
		Message,
		MessageBox
	} from 'element-ui';
	import store from '@/store';
	import CdfsImageList from "@/page/common/cdfsImageList";
	import mzRecord from "@/page/underwriting/underwritingManage/mzRecord";
	import rzRecord from "@/page/underwriting/underwritingManage/rzRecord";
	import {
		ImageQuerySearch
	} from "@/api/taskCenter/taskCommon";
	import {
		getListByParams
	} from '@/api/setting/maintain/declinatureCaouse.js';
	import {
		rateChanged
	} from '@/api/underwriting/jsMethods.js'
	//加费栏位权限动态控制
	import {
		queryListByCode
	} from '@/api/setting/maintain/publicFilesMaintenance.js'
	import {getSsyOrgMap} from "@/api/taskCenter/taskCommon";
  import { getCodeDictProjectApi } from "@/api/medicalLibrary/examProjectLibrary";
  import mixins from '@/utils/mixins'
	export default {
    mixins: [mixins],
		data() {
			return {
				//是否显示本地计算的累计保额
				showAmount:'N',
				//慕再系统
				showMzFlag: false,
				mzObj: {},
				mzmList:[],
				mzrList:[],
				ssyMap:{},
				//记录initpage时生成的随机字符串，用来控制多个窗口打开
				randomStr: '',
				//加费栏位权限
				feeAddTMList: [],
				feeAddOPPCList: [],
				feeAddTOList: [],
				feeAddNOList: [],
				//add MerYang PowerView系统对接需求 20230201
				clsList:[],
				dspList:[],
				ratList:[],
				csList:[],
				showPvFlag: false,
				pvObj:{},
				pvTabFlag: false,
				//add MerYang PowerView系统对接需求 20230201
				/* 费率条件*/
				flag03: "",
				flag03s: [{
						value: '1',
						label: '1-非吸烟超优体'
					},
					{
						value: '2',
						label: '2-非吸烟优选体'
					},
					{
						value: '3',
						label: '3-标准体'
					},
					{
						value: '4',
						label: '4-吸烟体'
					}
				],
				callPremEuabs: [], //本次加费试算后返回的险种list
				callPremBase: null, //本次加费试算后返回的一些总的费用
				callPremEuahs: [], //加费试算后返回的
				callPremType: '', //加费或者加费除外
				callPremSign: '',
				//AI核保数据
				medicalmultipleSelection: [],
				medicals: [], //查询到的影像数据
				aihebaoFlag: false,
				aihebaolistData: [],
        aiLoading: false,
        aiPages: {
          total: 0, // 总数
					pageIndex: 1, // 当前位于哪页
					pageSize: 10, // 1页显示多少条
					pageSizes: [5, 10, 15, 20], //每页显示多少条
					layout: "total, sizes, prev, pager, next, jumper", // 翻页属性
        },
				selectChooseSize: 0, //体检影像选择个数控制
				//AI核保数据
				//同客户保存所有投保人信息
				tabInsList: [],
				curTabName: '', //当前选中的投保人标签
				curInsPageData: {},
				//标注是否是当前页签
				claimChdrnum: '', //查询理赔时使用的保单号
				inithjFlag: false,
				appCusSize: 0,
				insCusSize: 0,
				wpNum: "",
				pbNum: "",
				resultNum: "",
				preData: {},
				preCalFlag: false,
				isInsPres: false,
				presFlag: false,
				insCusFlag: false,
				appCusFlag: false,
				resMsg: "",
				pyTitle: "英文/拼音姓名",
				isCancel: false,
				yqReason: [],
				qxReason: [],
				jbReason: [],
				isRead: false, //是否只读
				ppFlag: false,
				insNoteSize: 0,
				appNoteSize: 0,
				cancelApproval: false,
				resolveSign: null,
				isTBSX: false,
				customer: {},
				userInfo: "",
				isOpen: false,
				showImageFlag: false,
				showImageApplnum: '',
				docType: '',
				src: "",
				iframeWin: null,
				isPrintBtn: false,
				isPrint: false,
				susrgLoading: false,
				apLoading: false,
				allInfoReadOnly: false,
				loading: null,
				fullscreenLoading: false,
				applnum: "", //参数受理号
				pageSource: "", //参数页面来源
				isInsureTab: true,
				isAppTab: false,
				getIndex: null,
				recordFlag: false,
				complainFlag: false,
				cumAmountFlag: false,
				claimsFlag: false,
				saveDamageFlag: false,
				abnormityFlag: false,
				reportFlag: false,
				consignorFlag: false,
				healthFlag: false,
				notepadFlag: false,
				IDFlag: false,
				reviewFlag: false,
				appRecordFlag: false,
				appComplainFlag: false,
				appCumAmountFlag: false,
				appClaimsFlag: false,
				appSaveDamageFlag: false,
				appAbnormityFlag: false,
				appReportFlag: false,
				appConsignorFlag: false,
				appHealthFlag: false,
				appNotepadFlag: false,
				appIDFlag: false,
				appReviewFlag: false,
				activeName: 'first',
				activeName2: 'first',
				activeName3: 'first',
				activeName4: 'first',
				activeName5: 'one',
        activeName6: 'first',
				opinionDialogVisible: false,
				opinionData: [],
				opinionDialogVisible1: false,
				opinionDialogVisible2: false,
				opinionData2: [],
				opinionDialogVisible3: false,
				opinionData3: [],
				opinionDialogVisible4: false,
				opinionDialogVisible5: false,
				opinionDialogVisible6: false,
				opinionDialogVisible7: false,
				opinionDialogVisible8: false,
				opinionDialogVisible9: false,
				opinionDialogVisible10: false,
				opinionDialogVisible11: false,
				opinionDialogVisible12: false,
				opinionDialogVisible13: false,
				opinionDialogVisible14: false,
				opinionDialogVisible15: false,
				logo: logo,
				pageAttr: [], // 页面点击排序
				componentId: '',
				gobalEle: null,
				gobalExc: null,
				paginations: {
					total: 0, // 总数
					pageIndex: 1, // 当前位于哪页
					pageSize: 15, // 1页显示多少条
					pageSizes: [15], //每页显示多少条
					layout: "total, sizes, prev, pager, next, jumper", // 翻页属性
					pndesc: "",
					pntype: "",
					pncode: ""
				},
				pageData: [], //初始页面数据
				salesInfo: {}, //营销员信息
				insTabInfo: { //被保人头部信息
					insHistorys: [], //投保历史
					insNotepads: [], //notepad
					insPoss: [], //保全记录
					insClaims: [], //理赔记录
					insRenews: [], //续核记录
					insHealths: [], //异常告知
					insExams: [], //体检告知
					insSupplements: [], //补充告知
					insComplaints: [], //客户投诉记录
					insPres: [], //预核保
					clntnum: "",
					name: "",
					cardno: "",
				},

        // 第二被保人 start
        // 第二被保人头部信息
        secondCumAmountFlag: false,
        secondRecordFlag: false,
        secondNotepadFlag: false,
        secondSaveDamageFlag: false,
        secondClaimsFlag: false,
        secondReviewFlag: false,
        secondAbnormityFlag: false,
        secondHealthFlag: false,
        secondReportFlag: false,
        secondComplainFlag: false,
        secondIDFlag: false,
        secondConsignorFlag: false,
        secondPresFlag: false,
        secondInsCusFlag: false,
        secondInsTabInfo: {
          insHistorys: [], //投保历史
          insNotepads: [], //notepad
          insPoss: [], //保全记录
          insClaims: [], //理赔记录
          insRenews: [], //续核记录
          insHealths: [], //异常告知
          insExams: [], //体检告知
          insSupplements: [], //补充告知
          insComplaints: [], //客户投诉记录
          insPres: [], //预核保
          clntnum: "",
          name: "",
          cardno: "",
        },
        secondInsCusSize: 0,
        secondInsNoteSize: 0,
        isSecondInsureTab:false,
        isSecondInsPres: false,
        isSecondInsHistorys: false, //投保历史
        isSecondInsNotepads: false, //notepad
        isSecondInsCus: false, //客户查询
        isSecondInsPoss: false, //保全记录
        isSecondInsClaims: false, //理赔记录
        isSecondInsRenews: false, //续核记录
        isSecondInsHealths: false, //异常告知
        isSecondInsExams: false, //体检告知
        isSecondInsSupplements: false, //补充告知
        isSecondInsComplaints: false, //客户投诉记录
        // 第二被保人 end
				isInsHistorys: false, //投保历史
				isInsNotepads: false, //notepad
				isInsCus: false, //客户查询
				isAppCus: false, //客户查询
				isInsPoss: false, //保全记录
				isInsClaims: false, //理赔记录
				isInsRenews: false, //续核记录
				isInsHealths: false, //异常告知
				isInsExams: false, //体检告知
				isInsSupplements: false, //补充告知
				isInsComplaints: false, //客户投诉记录
				isAppHistorys: false, //投保历史
				isAppNotepads: false, //notepad
				isAppPoss: false, //保全记录
				isAppClaims: false, //理赔记录
				isAppRenews: false, //续核记录
				isAppHealths: false, //异常告知
				isAppExams: false, //体检告知
				isAppSupplements: false, //补充告知
				isAppComplaints: false, //客户投诉记录
				vip: "", //vip信息
				cusInfo: [], //客户信息对比
				eucm: {}, //核保意见对象
				bmntdesc: "", //核保意见
				lda_date: "", //系统当前时间
				curTime: "", //记录时间标志
				userId: "", //当前用户ID
				policyConclusions: uwconstant.policyConclusions, //保单核保结论
				eubaTypes: uwconstant.eubaTypes, //照会类型
				catablesConclusions: uwconstant.catablesConclusions, //险种核保结论
				catablesConclusions1: uwconstant.catablesConclusions1, //险种核保结论
				ratifies: uwconstant.ratifies, //核准项
				reasons: uwconstant.reasons, //原因
				pnCodes: [], //照会代码
				selectPncode: {}, //选中的照会信息
				curData: {}, //当前照会页面数据
				pnIndex: "",
				multipleSelection: [],
				isSameToOtherPolicy: false,
				premiumTempList: [], //加费明细
				premiumTempVO: {
					surname: "", //被保人
					polpln: "", //险种
					notedesc: "", //加费原因
					phi: "",
					pwp: "",
					prt: ""
				}, //加费信息
				opcdaSelect: uwconstant.opcdaSelect, //加费类别
				isPremiumCalc: false, //加费试算
				isPremiumAdd: false, //加费新增
				isPremiumDel: false, //加费删除
				isHiTr: false,
				isPrtTr: false,
				specialPre: true,
				curAddPremData: {
					addSumins: 0,
					is_dangflag: "N",
					is_indexflag: "N",
					gs_rimsg: 0,
					is_upd: "N",
					is_RULtimes: "N",
					is_calc: "N"
				}, //当前加费保单信息
				curAddPremObj: {}, //当前加费险种
				pageModifyFlag: false,
				postilTempVO: {
					surname: "",
					polpln: "",
					notedesc: ""
				}, //除外
				postilTempList: [], //除外明细
				isPostilAdd: false, //除外新增
				isPostilDel: false, //除外删除
				curPostilData: {}, //当前除外保单信息
				curPostilObj: {}, //当前除外险种
				tbloading: false, //照会查询loading
				cwLoading: false,
				curResolveList: [], //延期拒保
				curResolveObj: {}, //当前延期拒保的险种
				curResolveData: {},
				carepkyCodes: [], //原因码
				isApprovalDisabled: false,
				changeNoteViewData: { //承保变更通知书
					applnum: "", //受理号
					applName: "", //投保人
					insureName: "", //被保人
					saleName: "", //营销员
					saleDept: "", //营销服务部
					pnappdate: "", //照会日期
					reason: "", //加费原因/除外原因
					content: "", //内容
					today: "", //日期
					backDate: "",
					chdrnum: "", //保单号
          secondInsureName:"" // 第二被保人
				},
				notedescList: [], //险种说明
				curPageData: {}, //当前保单数据
				subUnLoading: false,
				antis: [], //欺诈信息
				euhm: {
					susrname: "",
					susrgname: ""
				}, //拼音姓名
				compare: {
					trailer4: '',
					eubas: '',
					trailer13: ''
				},

				printPnTimeOut1: null,
				printPnTimeOut2: null,
				backTimeOut: null,
				cancelApproTimeOut: null,
				saveAllInfoTimeOut: null,
				savePageDataTimeOut: null,
				doUwClickTimeOut: null,
				initUwPageTimeOut: null,
				initDataTimeOut1: null,
				initDataTimeOut2: null,
				initDataTimeOut3: null,
				initDataTimeOut4: null,
				initDataTimeOut5: null,
				appindChangedTimeOut: null,
				changeConclusionsTimeOut: null,
				decideChangedTimeOut: null,
				savePostilTimeOut: null,
				addPremSureTimeOut: null,
				calcClickTimeOut: null,

        templateSelection: "",
        //   当前选择的行的数据
        checkList: [],
        statusDic: [],
			}
		},
		components: {
			"insurance-records": InsuranceRecords,
			"suspend-nav": suspendNav,
			"customer-complaint": customerComplaint,
			"customer-info": customerInfo,
			"accumulated-premium": accumulatedPremium,
			"claims-records": claimsRecords,
			"keep-record": keepRecord,
			"abnormal-told": abnormalTold,
			"supplementary-told": supplementaryTold,
			"medical-report": medicalReport,
			"notepad": notepad,
			"pres": pres,
			"identity-card": identityCard,
			"review-opinion": reviewOpinion,
			"consignor": consignor,
			"cdfs-image-list": CdfsImageList,
			"mz-record": mzRecord,
			"rz-record": rzRecord
		},
		mounted() {
			// this.iframeWin = this.$refs.iframe.contentWindow
			// 监控照会点击照会代码 下拉框外隐藏弹框

			document.addEventListener('click', this.clickEvent)
			// console.log(this.$refs)
			// console.log(this.$refs['conclusions0'])
			// console.log(this.$refs['conclusions0'][0].$el)
			// this.$refs.$el.addEventListener('click',function(){});
			getSsyOrgMap().then(data => this.ssyMap = data);
		},
		methods: {
      // 获取任务状态字典值
      getCodeDictProject(){
        getCodeDictProjectApi({code: 'underwritingType'}).then(res => {
		  		if (res.resultCode == constant.SUCCESS) {
		  			this.statusDic = res.data
		  		}
		  	})
      },
			clickEvent(e) {
				let flag = this.isChild(e.target, this.$(this.gobalEle)[0]);
				let excflag = this.isChild(e.target, this.$(this.gobalExc)[0]);
				if (!(this.isChild(e.target, this.$('.select-main')[0])) && !flag) {
					this.opinionDialogVisible8 = false;
				}

				if (!(this.isChild(e.target, this.$('.except-main')[0])) && !excflag) {
					this.opinionDialogVisible15 = false;
				}
			},

			popMsg(message, type) {
				let _that = this;
				if (message) {
					_that.$message({
						message: message,
						type: type,
						showClose: true,
						duration: 15000
					});
					// _that.$alert(message, '提示', {
					//   confirmButtonText: '确定',
					//   type: type,
					//   callback: action => {
					//
					//   }
					// });
				}

			},

			showImageList(applnum) {
				this.showImageApplnum = applnum; //700029982
				this.showImageFlag = true;
			},
			hideImageList() {
				this.showImageApplnum = '';
				this.showImageFlag = false;
			},
			/* 慕再风险筛查*/
			mz(data) {
				//是否包含指定主险
				let isContains = false;
				let sumAmt = 0;
				//是否包含指定附加险
				let isContainFJ = false;
				data.trailer4.forEach(euab => {
					//是否是中信保诚「诚托未来」终身寿险
					if (euab.statFund == 'M' && ( this.mzmList && this.mzmList.indexOf(euab.crtable)>=0)) {
						isContains = true;
						sumAmt += euab.sumins;
					}
					if (euab.statFund =='R' && (this.mzrList && this.mzrList.indexOf(euab.crtable) >=0) ){
						isContainFJ = true;
						sumAmt += euab.sumins;
					}
				})
				if (!isContains) {
					this.popMsg("此保单无需执行风险筛查获取iRisk结果！", 'error');
					return;
				}
				//证件类型为身份证才行
				if (data.insLasInfo.idcardtype != '身份证') {
					this.popMsg("被保险人证件类型不为身份证，无法查询！", 'error');
					return;
				}
				let ladDate =  data.unipndPageList[0].lda_date
				ladDate = ladDate.substring(0,4)+"-"+ladDate.substring(4,6)+"-"+ladDate.substring(6,8)
				let birthday = data.insLasInfo.birthday.substring(0,4)+"-"+data.insLasInfo.birthday.substring(4,6)+"-"+data.insLasInfo.birthday.substring(6,8)
				let company = data.euaa.agntcoy+data.euaa.cntbranch;
				this.mzObj = {
					"clntnum": data.insLasInfo.clntnum,
					"policyNo": data.chdrnum ,
					"name": data.insLasInfo.name,
					"cardNum": data.insLasInfo.cardno,
					"sex": data.insLasInfo.gender,
					"birthday": birthday,
					"mobile": data.insLasInfo.moblie01,
					"riskType": "Life",
					"AmtSa": sumAmt,
					"EffectiveTime":ladDate,
					"InsureProvince":this.getOrgName(company)
				}
				if (isContainFJ) {
					this.mzObj["riskType"] = "Life,Adb";
				}
				this.showMzFlag = true;
			},
			getOrgName(value) {
			    if (this.ssyMap && this.ssyMap[value] && this.ssyMap[value].sprovname)
			        return this.ssyMap[value].sprovname;
			    else
			        return value;
			},
			//add MerYang PowerView系统对接需求 20230203
			pv(data) {
				//证件类型为身份证必须为18位
				let idType = "99";
				if (data.insLasInfo.idcardtype == '身份证') {
					idType = "01";
					if (data.insLasInfo.cardno.length != 18) {
						this.popMsg("被保险人身份证号应为18位！", 'error');
						return;
					}
				}
				//校验手机号码为11位
				if (data.insLasInfo.moblie01.length != 11) {
					this.popMsg("被保险人手机号应为11位！", 'error');
					return;
				}
				//校验姓名必须为中文
				var re = /[^\u4e00-\u9fa5]/;
				if (re.test(data.insLasInfo.name)) {
					this.popMsg("被保险人姓名只能为中文！", 'error');
					return;
				}
				//日期
				// let ladDate =  data.unipndPageList[0].lda_date
				// ladDate = ladDate.substring(0,4)+"-"+ladDate.substring(4,6)+"-"+ladDate.substring(6,8)
				//生日
				let birthday = data.insLasInfo.birthday.substring(0,4)+"/"+data.insLasInfo.birthday.substring(4,6)+"/"+data.insLasInfo.birthday.substring(6,8)
				//机构
				let company = data.euaa.agntcoy+data.euaa.cntbranch;
				let locationCode = this.getLocationCod(this.getOrgName(company));
				let gender = data.insLasInfo.gender == 'M' ? '1' : '0';
				this.pvObj = {
					"locationCode": locationCode,//地区编码
					"policyNum": data.chdrnum,//保单号
					"customerId": data.insLasInfo.clntnum,//客户号
					"idType": idType,//证件类型
					"identity": data.insLasInfo.cardno,//证件号
					"name": data.insLasInfo.name,//名字
					"phone": data.insLasInfo.moblie01,//手机号
					"gender": gender,//性别
					"birthday": birthday,//生日
					"productCode": data.trailer4[0].crtable,//保险产品编号
					"benefitCode": data.trailer4[0].crtable,//保险责任编号
					"benefitType": "05",//保险责任类型
					"benefitAmt": data.trailer4[0].sumins,//保额
					"procflg": data.euaa.procflg
				}
				this.showPvFlag = true;
			},
			pvProductFilter(data) {
        // S2023090627304 PIC-电商渠道中信保诚「祯祥世家」终身寿险C款系统需求添加险种'WLC0','WLCF','WLC6','WLCG','WLC7','WLCH','WLC8','WLCJ','WLC9','WLCK','WLCO','WLCL','WLCP','WLCM','WLCQ','WLCN'
				let productFilter = ['4PWC','4PW2','WLCB','WLC2','WLCC','WLCD','WLCE','WLC3','WLC4','WLC5', 'WLC0','WLCF','WLC6','WLCG','WLC7','WLCH','WLC8','WLCJ','WLC9','WLCK','WLCO','WLCL','WLCP','WLCM','WLCQ','WLCN'];
				let isContain = false;
				data.trailer4.forEach(euab => {
					//是否是中信保诚「传富世家」终身寿险
					if (productFilter.indexOf(euab.crtable) >=0){
						isContain = true;
					}
				});
				return isContain;
			},
			getLocationCod(orgName) {
				let comName = ["北京市","上海市","天津市","重庆市","安徽省","福建省","甘肃省","广东省",
				"广西壮族自治区","贵州省","海南省","河北省","河南省","黑龙江省","湖北省","湖南省","吉林省",
				"江苏省","江西省","辽宁省","内蒙古自治区","宁夏回族自治区","青海省","山东省","山西省","陕西省",
				"四川省","西藏自治区","新疆维吾尔自治区","云南省","浙江省","香港特别行政区","澳门特别行政区","台湾省"];
				
				for (let i=0;i<comName.length;i++) {
					if (comName[i].indexOf(orgName) != -1) {
						let code = ++i + '';
						return code.length === 1 ? '0' + code : code;
					}
				}
				return '01';
			},
			hidePvList() {
				this.showPvFlag = false;
			},
			//add MerYang PowerView系统对接需求 20230203
			hideMzList() {
				this.showMzFlag = false;
			},
			// 判断当前元素是否为某元素的子元素
			isChild(e, parent) {
				while (e != undefined && e != null && e.tagName.toUpperCase() != 'BODY') {
					if (e == parent) {
						return true;
					}
					e = e.parentNode;
				}
				return false;
			},
			toLogin() {
				store.dispatch('LogOut', {});
				MessageBox.confirm('您登录已失效，可以取消继续留在该页面，或者重新登录', '确定登出', {
					confirmButtonText: '重新登录',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					// location.reload();// 为了重新实例化vue-router对象 避免bug
					// window.location.href='http://128.232.11.204:30024/IPAS/index/nb/login'
					window.sessionStorage.setItem('tagActive', '')

					window.location.href = constant.loginUrl;
				});
			},
			doLogin(xhr) {
				// let loginUrl =  window.location.protocol+"//" + window.location.host;
				console.log("dologin:" + constant.loginUrl)
				console.log(xhr)
				if (xhr.status == "401") {

					MessageBox.confirm('您登录已失效，可以取消继续留在该页面，或者重新登录', '确定登出', {
						confirmButtonText: '重新登录',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						store.dispatch('LogOut', {});
						// location.reload();// 为了重新实例化vue-router对象 避免bug
						// window.location.href='http://128.232.11.204:30024/IPAS/index/nb/login'
						window.sessionStorage.setItem('tagActive', '')

						window.location.href = constant.loginUrl;
					});
				} else {
					Message({
						message: '系统异常,请稍后再试',
						type: 'error',
						duration: 15000,
						showClose: true,
					});
				}


			},
			// 切换主tab
			handleClick(tab, event) {
				if (this.activeName == "first") {
					this.isInsureTab = true;
          //屏蔽投保人标签
					this.isAppTab = false;
          // 屏蔽第二被保人标签
          this.isSecondInsureTab = false;
				} else if (this.activeName == "second") {
          this.isInsureTab = false;
          this.isAppTab = false;
          this.isSecondInsureTab = true;
        }else {
          this.isSecondInsureTab = false;
					this.isInsureTab = false;
					this.isAppTab = true;
					if (this.curTabName == tab.paneName) {

					} else {
						this.curTabName = tab.paneName;
						//屏蔽被保险人标签
						this.isAppCus = false; //客户查询
						this.isAppHistorys = false; //投保历史
						this.isAppNotepads = false; //notepad
						this.isAppPoss = false; //保全记录
						this.isAppClaims = false; //理赔记录
						this.isAppRenews = false; //续核记录
						this.isAppHealths = false; //异常告知
						this.isAppExams = false; //体检告知
						this.isAppSupplements = false; //补充告知
						this.isAppComplaints = false; //客户投诉记录
						this.appRecordFlag = false;
						this.appComplainFlag = false;
						this.appCumAmountFlag = false;
						this.appClaimsFlag = false;
						this.appSaveDamageFlag = false;
						this.appAbnormityFlag = false;
						this.appReportFlag = false;
						this.appConsignorFlag = false;
						this.appHealthFlag = false;
						this.appNotepadFlag = false;
						this.appIDFlag = false;
						this.appReviewFlag = false;
						this.appCusFlag = false;

						//未加载过数据
						for (var i = 0; i < this.tabInsList.length; i++) {
							let item = this.tabInsList[i];
							if (tab.paneName == item.appTabInfo.tabname) {
								this.curInsPageData = item;
								this.claimChdrnum = item.chdrnum;
								if (!item.isCheck) {
									console.log("加载头部投保人信息")
									this.initHeadInsList(item);
								}
							}
						}

					}
				}
			},

			handleClick1(data) {
				if (this.activeName2 == "first") {
					this.customer = data.insLasInfo;
					if(this.pvProductFilter(data)) {
						this.pvTabFlag = true;
					}
					// this.isInsureTab1 = true;
					// this.isAppTab1 = false;
				} else if (this.activeName6 == "first") {
          this.customer = data.secondInsLasInfo;
          this.pvTabFlag = false;
        }else {
					this.customer = data.appLasInfo;
					this.pvTabFlag = false;
					// this.isInsureTab1 = false;
					// this.isAppTab1 = true;
				}
			},

			//初始化子模块
			initFlag() {
				this.cumAmountFlag = false;
				this.recordFlag = false;
				this.notepadFlag = false;
				this.saveDamageFlag = false;
				this.claimsFlag = false;
				this.reviewFlag = false;
				this.abnormityFlag = false;
				this.healthFlag = false;
				this.reportFlag = false;
				this.complainFlag = false;
				this.IDFlag = false;
				this.consignorFlag = false;
				this.presFlag = false;
				this.appCumAmountFlag = false;
				this.appRecordFlag = false;
				this.appNotepadFlag = false;
				this.appSaveDamageFlag = false;
				this.appClaimsFlag = false;
				this.appReviewFlag = false;
				this.appAbnormityFlag = false;
				this.appHealthFlag = false;
				this.appReportFlag = false;
				this.appComplainFlag = false;
				this.appIDFlag = false;
				this.appConsignorFlag = false;


			},

      // 第二被保人需求 start
      secondShowItem(index) {
        console.log("第二被保人头部信息模块");
        console.log(index);
        if (index == 0) {
          this.secondCumAmountFlag = true;
        } else if (index == 1) {
          this.secondRecordFlag = true;
        } else if (index == 2) {
          this.secondNotepadFlag = true;
        } else if (index == 3) {
          this.secondSaveDamageFlag = true;
        } else if (index == 4) {
          this.secondClaimsFlag = true;
        } else if (index == 5) {
          this.secondReviewFlag = true;
        } else if (index == 6) {
          this.secondAbnormityFlag = true;
        } else if (index == 7) {
          this.secondHealthFlag = true;
        } else if (index == 8) {
          this.secondReportFlag = true;
        } else if (index == 9) {
          this.secondComplainFlag = true;
        } else if (index == 10) {
          this.secondIDFlag = true;
        } else if (index == 11) {
          this.secondConsignorFlag = true;
        } else if (index == 20) {
          this.secondPresFlag = true;
        } else if (index == 21) {
          this.secondInsCusFlag = true;
        }
      },
      // 第二被保人需求 end

			// 显示子模块
			showItem(index) {
				console.log(index) //
				// 需要判断 是投保人显示模块 还是被保人显示模块
				if (this.isInsureTab && !this.isAppTab) {
					if (index == 0) {
						this.cumAmountFlag = true;
					} else if (index == 1) {
						this.recordFlag = true;
					} else if (index == 2) {
						this.notepadFlag = true;
					} else if (index == 3) {
						this.saveDamageFlag = true;
					} else if (index == 4) {
						this.claimsFlag = true;
					} else if (index == 5) {
						this.reviewFlag = true;
					} else if (index == 6) {
						this.abnormityFlag = true;
					} else if (index == 7) {
						this.healthFlag = true;
					} else if (index == 8) {
						this.reportFlag = true;
					} else if (index == 9) {
						this.complainFlag = true;
					} else if (index == 10) {
						this.IDFlag = true;
					} else if (index == 11) {
						this.consignorFlag = true;
					} else if (index == 20) {
						this.presFlag = true;
					} else if (index == 21) {
						this.insCusFlag = true;
					}
				} else if (!this.isInsureTab && this.isAppTab) {
					if (index == 0) {
						this.appCumAmountFlag = true;
					} else if (index == 1) {
						this.appRecordFlag = true;
					} else if (index == 2) {
						this.appNotepadFlag = true;
					} else if (index == 3) {
						this.appSaveDamageFlag = true;
					} else if (index == 4) {
						this.appClaimsFlag = true;
					} else if (index == 5) {
						this.appReviewFlag = true;
					} else if (index == 6) {
						this.appAbnormityFlag = true;
					} else if (index == 7) {
						this.appHealthFlag = true;
					} else if (index == 8) {
						this.appReportFlag = true;
					} else if (index == 9) {
						this.appComplainFlag = true;
					} else if (index == 10) {
						this.appIDFlag = true;
					} else if (index == 11) {
						this.appConsignorFlag = true;
					} else if (index == 22) {
						this.appCusFlag = true;
					}
				}

				// 页面重新排序
				this.pageSort(index);

			},

			// 页面重新排序
			pageSort(pageIndex) {
				this.pageAttr.push(pageIndex);
				//去重
				let attr = [];
				let obj = {};
				for (let i of this.pageAttr) {
					if (!obj[i]) {
						attr.push(i);
						obj[i] = true;
					}
				}
				console.log(attr);
				this.pageAttr = attr;

				this.componentId = 'insurance-records';

			},

			//切换保单
			changePolicy(chdrnum) {
				this.pageData.forEach(item => {
					if (item.chdrnum == chdrnum) {
						this.curPageData = item;
						//切换费率
						this.flag03 = this.curPageData.insBaseInfo.flag03;
					}
				})
        // 重新请求AI核保列表数据
        this.getAiTask()

				//标记颜色
				//1、判断投保人个数
				let index = 0;
				if (this.tabInsList && this.tabInsList.length > 1) {
					for (var i = 0; i < this.tabInsList.length; i++) {
						let item = this.tabInsList[i];
						if (this.curTabName != item.appTabInfo.tabname && item.appTabInfo.clntnum == this.curPageData
							.appBaseInfo.clntnum) {
							let key_list = this.$refs;
							for (var key in key_list) {
								if (key.indexOf("ref") >= 0 && index == 0) {
									index = 1;
									this.changeColor(key_list[key][0].$parent.$el, item.appTabInfo.name);
								}

							}

						}
					}
				}
			},
			//费率
			getFlag03Name(value) {
				let name = "";
				for (var index in this.flag03s) {
					if (this.flag03s[index].value == value) {
						name = this.flag03s[index].label;
						name = name.substring(name.indexOf("-") + 1, name.length);
					}
				}
				return name;
			},
			rateChanged(event, item) {
				let that = this;

				that.$confirm("系统将按费率档次重算保费", '提示', {
					confirmButtonText: '继续',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					//将最新的值压档到对应的被保险人euad的flag03
					// that.subUnLoading = true;
					that.curPageData.insBaseInfo.flag03 = that.flag03;
					that.wfCalcPrem(item, "", "", "rate", that.flag03);
					//如果存在TLF照会，则修改里面的内容，不存在，则调后台获取照会数据，然后修改占位符
					// that.subUnLoading = false;
					let isContainTFL = false;

					let newZbinsPrem = 0.0;
					that.curPageData.trailer4.forEach(euab => {
						if (euab.statFund == 'M') {
							newZbinsPrem = euab.zbinstprem; //基本保费
						}
					});
					that.curPageData.eubas.forEach(euba => {
						if (euba.pncode.indexOf('TFL') >= 0) {
							isContainTFL = true;
						}
					});
					if (!isContainTFL) {
						let url = appName.NEWUNDR + '/unipnd/nucleusNote/queryEufaByPncode';
						let param = {
							"pncode": "TFL"
						};
						let res = uwLoadJs.ajaxRequest(param, url);
						if (res == null) {
							return false;
						}
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							let eufa = res.data;
							let ls_date = that.curPageData.unipndPageList[0].lda_date;
							let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) + "-" + ls_date
								.substring(6, 8);
							let lt_time = uwJs.showTime();
							let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) + ":" +
								lt_time.substring(12, 14);
							let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time
								.substring(12, 14);

							let euba = {
								applnum: that.curPageData.curApplnum,
								zresnpd: eufa.zresnpd,
								chdrnum: that.curPageData.chdrnum,
								memodesc: (that.curPageData.euaa.tsalesunt + lt_time.substring(2)),
								pndate: that.curPageData.unipndPageList[0].lda_date,
								dateend: "0",
								forceind: eufa.forceind,
								resind: eufa.resind,
								prtopt: eufa.prtopt,
								zprtcert: "",
								reminddate: "0",
								remindflg: "N",
								crtuser: that.curPageData.unipndPageList[0].userId,
								dtecrt: that.curPageData.unipndPageList[0].lda_date,
								crttime: ll_time1,
								nofday: eufa.nofday,
								source: eufa.source,
								jobName: uwconstant.jobName,
								userProfile: that.userId,
								datime: that.curPageData.unipndPageList[0].lda_date,
								as_hand: "",
								clntnum: that.curPageData.insBaseInfo.clntnum,
								pncode: "TFL",
								procflg: "",
								pedesc: eufa.pedesc,
								as_pndate: that.curPageData.unipndPageList[0].lda_date,
								rprntdate: "0",
								userid: "",
								pnfrom: that.userId,
								as_dateend: "",
								pncodeBg: "RF",
								pedescBg: "RB",
								pntype: '1',
								authnow: eufa.authnow,
								clntnumSelectBg: "RB",
								num: that.curPageData.eubas.length
							}

							that.curPageData.eubas.push(euba);
						}
					}
					that.curPageData.eubas.forEach(euba => {
						if (euba.pncode.indexOf('TFL') >= 0) {
							let mark1 = euba.pedesc.indexOf("适用") + 2;
							let mark2 = euba.pedesc.indexOf("费率");
							let mark3 = euba.pedesc.indexOf("保费为") + 3;
							let mark4 = euba.pedesc.indexOf("元/期");
							euba.pedesc = euba.pedesc.slice(0, mark1) + that.getFlag03Name(event) +
								euba.pedesc.slice(mark2, mark3) + newZbinsPrem +
								euba.pedesc.slice(mark4);
						}
					});
					that.setData(that.curPageData);
				}).catch(() => {
					//将费率还原
					that.flag03 = that.curPageData.insBaseInfo.flag03;
				});

			},
			changeColor(div, title) {
				let element = div.querySelector('div[role=tablist]')
				let child = element.firstChild;
				let i = 0;
				let len = element.childNodes.length;
				while (i < len) {
					if (child.innerText == title) {
						child.style.color = 'royalblue'
					} else {
						child.style.color = 'black'
					}
					child = child.nextSibling;
					i++;
				}
			},
			//决定同其他保单
			changeToOther(pageData) {
				let _that = this;
				this.isSameToOtherPolicy = pageData.isSameToOtherPolicy;
				if (this.isSameToOtherPolicy) {
					let approval = "";
					_that.pageData.forEach(data => {
						if (_that.curPageData.curApplnum == data.curApplnum) {
							approval = data.euaa.approval;
							_that.curPageData = data;
						}
					})
					if (approval == "S") {
						let datas = [];
						_that.pageData.forEach(data => {
							if (_that.curPageData.curApplnum != data.curApplnum) {
								if (data.euaa.approval != "" && data.euaa.approval != "S") {
									_that.popMsg("保单：" + data.euaa.chdrnum + "已有非标准体的结论", 'warning');
								} else {
									let count = 0;
									data.trailer4.forEach(item => {
										if (item.approval == "" || item.approval == "S") {
											count++;
										}
									})
									//
									if (count != data.trailer4.length) {
										_that.popMsg("保单：" + data.euaa.chdrnum + "已有非标准体的险种结论", 'warning');
									} else {
										// if (_that.ofPendingCheck(data) == -1) {
										//   _that.$message({
										//     message: "保单：" + data.euaa.chdrnum + "照会事项未处理完成",
										//     type: 'warning'
										//   });
										// }
									}
								}
							}
							datas.push(data);
						})
						// _that.pageData = datas;
					}
				}

				this.setData(pageData);
			},

			showLoading(e) {
				this.subUnLoading = e;
			},

			//投保人客户关系图谱
			toCustomerInfo(cusInfo) {
				let sex = "";
				if (cusInfo.sex == "女") {
					sex = "F";
				} else if (cusInfo.sex == "男") {
					sex = "M";
				}
				let url = uwconstant.queryCustomerUrl + cusInfo.clntnum +
					"?customerNo=" + cusInfo.clntnum + "&customerName=" + cusInfo.oldName +
					"&sex=" + sex + "&reset=true";

				window.open(url);
			},



			/***************************页面其他操作 BEGIN**********************************************/
			//跳转客户管理
			toShowCustomer(cardno) {
				if (cardno) {
					// this.$router.push({path:"/customer/customerInfo?idno="+cardno});
					this.$router.push({
						path: "/customer/customerInfo",
						query: {
							idno: cardno
						}
					})
				}

			},

			// 显示投保人英文/拼音姓名
			showNameInfo(type, data) {
				let crtable = "";
				let trailer4 = data.trailer4;
				trailer4.forEach(item => {
					if (item.statFund == "M") {
						crtable = item.crtable;
					}
				});

				if (crtable == "") {
					this.popMsg("主险代码为空", 'error');
					return false;
				}

				let idno = "";
				if (type == 0) {
					this.pyTitle = "被保人英文/拼音姓名";
					idno = data.insBaseInfo.clntnum;
				} else if(type == 2) {
          // 第二被保人需求
          this.pyTitle = "第二被保人英文/拼音姓名";
          idno = data.secondInsBaseInfo.clntnum;
        }
        else {
					this.pyTitle = "投保人英文/拼音姓名";
					idno = data.appBaseInfo.clntnum;
				}

				this.susrgLoading = true;
				let paras = {
					"crtable": crtable,
					"serno": data.euaa.serno,
					"chdrnum": data.chdrnum,
					"clntnum": idno,
				}
				showYwpyxm(paras).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.euhm = res.data;
						this.euhm.clntnum = idno;
						//投被保人的拼音回写
						this.euhm.serno = this.curPageData.curApplnum;
						this.euhm.chdrnum = this.curPageData.chdrnum
						this.opinionDialogVisible11 = true;
					}
					this.susrgLoading = false;
				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})


			},

			//保存英文/拼音姓名
			saveClient() {
				let hanz = new RegExp("[\\u4E00-\\u9FFF]+", "g");
				let shuz = new RegExp("[0-9]", "g");
				this.euhm['userProfile'] = this.userId;
				if (hanz.test(this.euhm.susrname) || shuz.test(this.euhm.susrname)) {
					this.popMsg("姓不能含有中文、数字！", 'error');
					return false;
				}
				if (hanz.test(this.euhm.susrgname) || shuz.test(this.euhm.susrgname)) {
					this.popMsg("名不能含有中文、数字！", 'error');
					return false;
				}

				let params = {
					"euhm": JSON.stringify(this.euhm)
				}
				saveEuhmpfBySerno(params).then(res => {
					if (res.resultCode == constant.SUCCESS) {
						this.popMsg("保存成功！", 'success');
						this.opinionDialogVisible11 = false;
					}

				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})

			},

			// 客户信息资料比对 0-被保人 1-投保人 2-第二被保人
			showBaseInfo(type, data) {
				let base = {};
				let las = {};
				if (type == 0) {
					base = data.insBaseInfo;
					las = data.insLasInfo;
				} else if(type == 2) {
          // 第二被保人需求
          base = data.secondInsBaseInfo;
          las = data.secondInsLasInfo;
        } else {
					base = data.appBaseInfo;
					las = data.appLasInfo;
				}

				this.cusInfo = [{
						name: "姓名",
						base: base == null ? "" : base.name,
						las: las == null ? "" : las.name
					},
					{
						name: "性别",
						base: base == null ? "" : base.sex,
						las: las == null ? "" : las.sex
					},
					{
						name: "出生日期",
						base: base == null ? "" : base.birthday,
						las: las == null ? "" : las.birthday
					},
					{
						name: "证件类型",
						base: base == null ? "" : base.idcardtype,
						las: las == null ? "" : las.idcardtype
					},
					{
						name: "证件号码",
						base: base == null ? "" : base.cardno,
						las: las == null ? "" : las.cardno
					},
					{
						name: "有效期类型",
						base: base == null ? "" : base.cardflag,
						las: las == null ? "" : las.cardflag
					},
					{
						name: "有效期起始日",
						base: base == null ? "" : base.dateup02,
						las: las == null ? "" : las.dateup02
					},
					{
						name: "有效期截止日",
						base: base == null ? "" : base.dateup,
						las: las == null ? "" : las.dateup
					},
					{
						name: "通讯地址",
						base: base == null ? "" : base.addr01,
						las: las == null ? "" : las.addr01
					},
					{
						name: "手机",
						base: base == null ? "" : base.moblie01,
						las: las == null ? "" : las.moblie01
					},
					{
						name: "住宅电话",
						base: base == null ? "" : base.moblie02,
						las: las == null ? "" : las.moblie02
					},
					{
						name: "单位电话",
						base: base == null ? "" : base.moblie03,
						las: las == null ? "" : las.moblie03
					},
				]
				this.opinionDialogVisible12 = true;
			},
			//百融平台
			brpt(data) {
				this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
				if (this.userInfo == null) {
					this.toLogin();
					return false;
				}
				let path = uwconstant.cwrsUrl;
				let sysFrom = uwconstant.sysFrom; //系统来源
				let userCode = this.userInfo.account; //登录用户编码
				let userName = this.userInfo.chinesename; //登录用户姓名
				let bsnNum = new Date().getTime(); //业务号
				let id = this.customer.cardno ? this.customer.cardno : ""; //身份证Id
				let HomeAddr = this.customer.addr01 ? this.customer.addr01 : ""; //被查询客户家庭地址
				let bizAddr = this.customer.addr01 ? this.customer.addr01 : ""; //被查询客户公司地址
				let name = this.customer.name ? this.customer.name : ""; //被查询客户名称
				let cell = this.customer.moblie01 ? this.customer.moblie01 : ""; //被查询客户手机号码
				let interType = "10"; //接口类型
				path +=
					'?sysFrom=' + sysFrom +
					'&userCode=' + userCode +
					'&userName=' + userName +
					'&id=' + id +
					'&bsnNum=' + bsnNum +
					'&cell=' + cell +
					'&name=' + name +
					'&bizAddr=' + bizAddr +
					'&HomeAddr=' + HomeAddr +
					'&interType=' + interType;
				console.log(path);
				window.open(path);
			},
			//亿保创元平台
			ebcypt(data) {
				this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
				if (this.userInfo == null) {
					this.toLogin();
					return false;
				}
				let path = uwconstant.cwrsUrl;
				let sysFrom = uwconstant.sysFrom; //系统来源
				let userCode = this.userInfo.account; //登录用户编码
				let userName = encodeURIComponent(this.userInfo.chinesename); //登录用户姓名
				let bsnNum = new Date().getTime(); //业务号
				let cardNo = this.customer.cardno ? this.customer.cardno : ""; //证件号码
				let birthDate = ""; //出生日期yyyy-MM-dd
				if (Number(this.customer.birthday) > 0) {
					birthDate = this.customer.birthday.substring(0, 3) +
						"-" + this.customer.birthday.substring(4, 5) +
						"-" + this.customer.birthday.substring(6, 7);
				}
				let gander = this.customer.gender ? this.customer.gender : ""; //性别
				let paymentCaseCode = ""; //赔案号
				let custName = ""; //客户姓名
				if (this.customer.name != "" && this.customer.name != null) {
					custName = encodeURIComponent(this.customer.name);
				}
				let custNo = this.customer.clntnum ? this.customer.clntnum : ""; //客户号
				let interType = "30"; //接口类型
				path +=
					'?sysFrom=' + sysFrom +
					'&userCode=' + userCode +
					'&userName=' + userName +
					'&bsnNum=' + bsnNum +
					'&cardNo=' + cardNo +
					'&birthDate=' + birthDate +
					'&gander=' + gander +
					'&custNo=' + custNo +
					'&custName=' + custName +
					'&paymentCaseCode=' + paymentCaseCode +
					'&interType=' + interType;
				console.log(path);
				window.open(path);
			},
			//中保信意健险
			zbxyjx(data) {
				this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
				if (this.userInfo == null) {
					this.toLogin();
					return false;
				}
				let path = uwconstant.cwrsUrl;
				let sysFrom = uwconstant.sysFrom; //系统来源
				let userCode = this.userInfo.account; //登录用户编码
				let userName = encodeURIComponent(this.userInfo.chinesename); //登录用户姓名
				let policyNum = data.chdrnum; //投保单号
				let policyCode = ""; //保单号
				let paymentCaseCode = ""; //赔案号
				let policyName = encodeURIComponent(data.insLasInfo.name); //被保人姓名
				let certType = data.insLasInfo.idtype ? data.insLasInfo.idtype : ""; //被保人证件类型
				let certCode = data.insLasInfo.cardno ? data.insLasInfo.cardno : ""; //被保人证件号码
				let interType = "40"; //接口类型
				path +=
					'?sysFrom=' + sysFrom +
					'&userCode=' + userCode +
					'&userName=' + userName +
					'&policyNum=' + policyNum +
					'&policyCode=' + policyCode +
					'&paymentCaseCode=' + paymentCaseCode +
					'&policyName=' + policyName +
					'&certType=' + certType +
					'&certCode=' + certCode +
					'&interType=' + interType;
				console.log(path);
				window.open(path);
			},
			//中保信银行卡验真
			zbxyhkyz() {
				this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
				if (this.userInfo == null) {
					this.toLogin();
					return false;
				}
				let path = uwconstant.cwrsUrl;
				let sysFrom = uwconstant.sysFrom; //系统来源
				let userCode = this.userInfo.account; //登录用户编码
				let userName = encodeURIComponent(this.userInfo.chinesename); //登录用户姓名
				let bsnNum = new Date().getTime(); //业务号
				let cardNo = this.customer.cardno ? this.customer.cardno : ""; //证件号码
				let bankNo = this.customer.bankNo ? this.customer.bankNo : ""; //银行卡号
				let certType = this.customer.idtype ? this.customer.idtype : ""; //证件类型
				let custNo = this.customer.clntnum ? this.customer.clntnum : ""; //客户编号
				let custName = this.customer.name ? encodeURIComponent(this.customer.name) : ""; //客户姓名
				let phone = this.customer.moblie01 ? this.customer.moblie01 : ""; //联系电话
				let interType = "20"; //接口类型
				path +=
					'?sysFrom=' + sysFrom +
					'&userCode=' + userCode +
					'&userName=' + userName +
					'&bsnNum=' + bsnNum +
					'&cardNo=' + cardNo +
					'&bankNo=' + bankNo +
					'&certType=' + certType +
					'&custNo=' + custNo +
					'&custName=' + custName +
					'&phone=' + phone +
					'&interType=' + interType;
				console.log(path);
				window.open(path);
			},

			// 反欺诈
			showCheat(pageData) {
				let that = this;
				this.subUnLoading = true;
				let apnum = "N_" + pageData.curApplnum;
				let params = {
					"apnum": apnum
				};
				let url = appName.NEWUNDR + '/anti/antiFraud/findList';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}

				if (res.resultCode == constant.SUCCESS && res.data != null) {
					that.antis = res.data;
				} else {
					that.popMsg(res.resultMsg, 'error');
					return false;
				}

				this.subUnLoading = false;
				this.opinionDialogVisible13 = true;
			},

			// 营销员信息
			salesShow(data) {
				console.log(data);
				this.subUnLoading = true;
				this.salesInfo = data;
				if (data.agntnum02) {
					let params = {
						"agentId": data.agntnum02
					};
					let url = appName.NEWUNDR + '/unipnd/customer/getLevel';
					let res = uwLoadJs.ajaxRequest(params, url);
					if (res == null) {

					} else if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.salesInfo.agentClass02 = res.data;
					}
				}

				this.subUnLoading = false;
				this.opinionDialogVisible6 = true;
			},

			// 承保变更内容
			contentChange(pageData) {
				let that = this;
				if (pageData.eubas.length <= 0) {
					that.popMsg("没有照会信息", 'error');
					return false;
				}

				if (pageData.euaa.approval == "W") {
					that.popMsg("保单已取消", 'error');
					return false;
				}
				let eutas = [];
				let eutbs = [];
				let eutcs = [];
				let eutds = [];
				let pncodes = [];

				let params = {
					"applnum": pageData.curApplnum,
					"userId": this.userId
				}
				let url = appName.NEWUNDR + '/unipnd/premium/findInfoByApplnum';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}

				if (res.resultCode == constant.SUCCESS && res.data != null) {
					eutas = res.data.eutas;
					eutbs = res.data.eutbs;
					eutcs = res.data.eutcs;
					eutds = res.data.eutds;
					pncodes = res.data.pncodes;
				}

				let appClntnum = that.curPageData.appBaseInfo.clntnum;
				let insClntnum = that.curPageData.insBaseInfo.clntnum;
				let postilReasonApp = ""; //投保人除外原因
				let postilReasonIns = ""; //被保人除外原因
				let postilContent = ""; //除外内容
				if (eutas.length > 0) {
					console.log("承保变更通知书预览打印所有除外原因：" + JSON.stringify(eutas))
					eutas.forEach(item => {
						if (item.clntnum == insClntnum) {
							postilReasonIns = postilReasonIns = item.notedesc;
						} else {
							postilReasonApp = postilReasonApp + item.notedesc;
						}
					})
				}

				let eutbcodes = [];
				if (eutbs.length > 0) {
					eutbs.forEach(item => {
						eutbcodes.push(item.pncode);
					})
				}
				let priumReasonApp = ""; //投保人加费原因
				let priumReasonIns = ""; //被保人加费原因
				let priumContent = ""; //加费内容
				let eutdcodes = [];
				if (eutcs.length > 0) {
					console.log("承保变更通知书预览打印所有加费原因：" + JSON.stringify(eutas))
					eutcs.forEach(item => {
						if (item.clntnum == insClntnum) {
							priumReasonIns = priumReasonIns = item.notedesc;
						} else {
							priumReasonApp = priumReasonApp + item.notedesc;
						}
					})
				}
				if (eutds.length > 0) {
					eutds.forEach(item => {
						eutdcodes.push(item.pncode);
					})
				}

				//延期，拒保，取消原因
				let cancelContent = "";
				let cancelReason = "";
				let oldList = [];
				let addCount = 0;
				let postilCount = 0;
				let cancelCount = 0;
				pageData.trailer4.forEach(item => {
					if (item.approval == "A") {
						addCount++;
					} else if (item.approval == "C") {
						postilCount++;
					} else if (item.approval == "D" || item.approval == "P") {
						cancelCount++;
					} else if (item.approval == "B") {
						addCount++;
						postilCount++;
					}
				});

				pageData.trailer4.forEach(item => {
					if (item.approval == "D") { //拒保
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "01") {
								oldList.push(note);
							}
						})
					} else if (item.approval == "P") { //延期
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "02") {
								oldList.push(note);
							}
						})
					} else if (item.approval == "W") { //取消
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "03") {
								oldList.push(note);
							}
						})
					} else if (item.approval == "W") { //加费
					} else if (item.approval == "W") { //除外
					}
				})
				for (let i = 0; i < oldList.length; i++) {
					cancelReason = cancelReason + oldList[i].notedesc;
				}

				if (pageData.eubas.length > 0) {
					let j = 1;

					let jfcodes = [];
					if (addCount > 0) {
						//首期保费放第一行
						for (let i = 0; i < pageData.eubas.length; i++) {
							let item = pageData.eubas[i];
							if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode == "C01" && (item.procflg !=
									"X" || item.procflg == "")) {
								priumContent = priumContent + "<p class='txt-content'>" + j + "、" + item.pedesc + "</p>";
								j++
								break;
							}
						}
						//险种配置的加费照会

						pageData.trailer4.forEach(item => {

							//查询险种配置的加费照会
							if (item.approval == 'A' || item.approval == 'B') {
								let params = {
									"crtable": item.crtable
								}
								let url1 = appName.NEWUNDR + '/unipnd/premium/findPncodeByCrtable';
								let res1 = uwLoadJs.ajaxRequest(params, url1);
								if (res1 == null) {
									return false;
								}
								if (res1.resultCode == constant.SUCCESS && res1.data != null) {
									let ls_pncode = res1.data.trim();
									if (ls_pncode) {
										jfcodes.push(ls_pncode)
									}
								}
							}
						})

						//加费照会
						pageData.eubas.forEach(item => {
							for (let i = 0; i < jfcodes.length; i++) {
								let pncode = jfcodes[i];
								if (item.pncode == pncode && (item.procflg != "X" || item.procflg == "") && item
									.pncode != "C01") {
									if ((item.zresnpd == "04" || item.zresnpd == "09")) {
										priumContent = priumContent + "<p  class='txt-content'>" + j + "、" + item
											.pedesc + "</p>";
										j++;
									}


								}
							}
							if ((item.procflg != "X" || item.procflg == "") && item.pncode == "C85") {
								if (item.zresnpd == "04" && item.pncode.substring(0, 1) == "E") {

								} else {
									if ((item.zresnpd == "04" || item.zresnpd == "09")) {
										priumContent = priumContent + "<p  class='txt-content'>" + j + "、" + item
											.pedesc + "</p>";
										j++;
									}
								}
							}
							// for(let i = 0;i<eutbcodes.length;i++){
							//   let pncode = eutbcodes[i];
							//   if(item.pncode==pncode && (item.procflg!="X" || item.procflg=="") && item.pncode!="C01"){
							//     if (item.zresnpd == "04" && item.pncode.substring(0,1)=="E"){
							//
							//     }else{
							//       priumContent = priumContent+"<p>"+j+"、"+item.pedesc+"</p>";
							//       j++;
							//     }
							//   }
							//
							// }
						})

					}


					let cwcodes = [];
					if (postilCount > 0) {
						//除外照会
						for (let i = 0; i < pageData.eubas.length; i++) {
							let item = pageData.eubas[i];
							if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode == "EE1" && (item.procflg !=
									"X" || item.procflg == "")) {
								postilContent = postilContent + "<p  class='txt-content'>" + j + "、" + item.pedesc +
								"</p>";
								j++;
								break;
							}
						}

						pageData.eubas.forEach(item => {
							for (let i = 0; i < eutbcodes.length; i++) {
								let pncode = eutbcodes[i];
								if (item.pncode == pncode && (item.procflg != "X" || item.procflg == "") && item
									.pncode != "EE1") {
									if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode.substring(0,
											1) == "E" && jfcodes.indexOf(pncode) < 0) {
										postilContent = postilContent + "<p  class='txt-content'>" + j + "、" + item
											.pedesc + "</p>";
										cwcodes.push(item.pncode);
										j++;
									}
								}
							}

						})
					}


					if (cancelCount > 0) {
						let pdcodes = [];
						//拒保延期配置的照会
						for (let i = 0; i < pageData.trailer4.length; i++) {
							let euab = pageData.trailer4[i];
							if (euab.approval == 'P' || euab.approval == 'D') {
								let pcode = this.getCwPncode(euab.crtable);
								if (pcode) {
									pdcodes.push(pcode);
								}
							}
						}
						//延期、拒保照会
						pageData.eubas.forEach(item => {

							if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode == "N01" && (item
									.procflg != "X" || item.procflg == "")) {
								cancelContent = cancelContent + "<p  class='txt-content'>" + j + "、" + item
									.pedesc + "</p>";
								j++;
							}
							if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode == "N02" && (item
									.procflg != "X" || item.procflg == "")) {
								cancelContent = cancelContent + "<p  class='txt-content'>" + j + "、" + item
									.pedesc + "</p>";
								j++;
							}

							// for(let i = 0;i<pncodes.length;i++){
							//   let pncode = pncodes[i];
							//   if(item.pncode==pncode && (item.procflg!="X" || item.procflg=="")){
							//     priumContent = priumContent+"<p>"+j+"、"+item.pedesc+"</p>";
							//     j++;
							//   }
							// }
							for (let i = 0; i < pdcodes.length; i++) {
								let pncode = pdcodes[i];
								if ((item.zresnpd == "04" || item.zresnpd == "09") && item.pncode == pncode && (
										item.procflg != "X" || item.procflg == "")) {
									let count = 0; //取出重复
									for (let m = 0; m < cwcodes.length; m++) {
										if (cwcodes[m] == item.pncode) {
											count++;
										}
									}

									if (count == 0) {
										cancelContent = cancelContent + "<p  class='txt-content'>" + j + "、" + item
											.pedesc + "</p>";
										j++;
									}

								}
							}


						})
					}



				}

				let reason = "";

				if (addCount > 0) {
					if (priumReasonIns != "") {
						reason = reason + priumReasonIns;
					}
				}
				if (postilCount > 0) {
					if (postilReasonIns != "") {
						if (reason != "") {
							if (postilReasonIns != "") {
								reason = reason + "、" + postilReasonIns;
							}
						} else {
							reason = postilReasonIns + "、";
						}
					}
				}
				if (addCount > 0) {
					if (priumReasonApp != "") {
						if (reason != '') {
							reason = reason + "、" + priumReasonApp;
						} else {
							reason = priumReasonApp + "、";
						}
					}
				}
				if (postilCount > 0) {
					if (postilReasonApp != "") {
						if (reason != "") {
							if (postilReasonApp != "") {
								reason = reason + "、" + postilReasonApp;
							}
						} else {
							reason = postilReasonApp;
						}
					}
				}







				if (cancelCount > 0) {
					if (reason != "") {
						if (cancelReason != "") {
							reason = reason + "、" + cancelReason;
						}
					} else {
						reason = cancelReason;
					}
				}

				if (reason && reason.length > 2) {
					let inde = reason.lastIndexOf("、");
					if (inde == reason.length - 1) {
						reason = reason.substring(0, reason.length - 1);
					}

				}


				let pnBackDate = pageData.euaa.pnBackDate + "";
				if (pnBackDate != "99999999" && pnBackDate != "0") {
					let m = pnBackDate.substring(4, 6);
					if (m.length == 1) {
						m = "0" + m;
					}
					let d = pnBackDate.substring(6, 8);
					if (d.length == 1) {
						d = "0" + d;
					}

					pnBackDate = pnBackDate.substring(0, 4) + "年" + m + "月" + d + "日";
				} else {
					pnBackDate = "9999年99月99日";
				}

				let dateTime = new Date();
				let year = dateTime.getFullYear();
				let month = dateTime.getMonth() + 1;
				let date = dateTime.getDate();
				if (Number(month) < 10) {
					month = "0" + month;
				}
				if (Number(date) < 10) {
					date = "0" + date;
				}

				let now = year + "年" + month + "月" + date + "日";

				//承保变更通知书
				this.changeNoteViewData.applnum = pageData.curApplnum; //受理号
				this.changeNoteViewData.applName = pageData.appBaseInfo.name; //投保人
				this.changeNoteViewData.insureName = pageData.insBaseInfo.name; //被保人
				this.changeNoteViewData.saleName = pageData.euaa.saleman; //营销员
				this.changeNoteViewData.saleDept = pageData.euaa.agntcoy + "/" + pageData.euaa.cntbranch; //营销服务部
				this.changeNoteViewData.pnappdate = pageData.euaa.pnappdate; //照会日期
				this.changeNoteViewData.reason = reason; //加费原因/除外原因
				this.changeNoteViewData.content = priumContent + postilContent + cancelContent; //内容
				this.changeNoteViewData.today = now; //日期
				this.changeNoteViewData.backDate = pnBackDate;
				this.changeNoteViewData.chdrnum = pageData.chdrnum; //保单号
				this.opinionDialogVisible7 = true;

        // 第二被保人需求 start
        this.changeNoteViewData.secondInsureName = pageData.secondInsBaseInfo.name;
        // 第二被保人需求 end
			},

			//打印
			printPn() {
				// console.log(this.$print)
				// this.$print(this.$refs.print)
				// v-print="'#changeNoteView'"

				// this.$print(this.$refs.print)

				// let newWindow;
				// //打开一个新的窗口
				// newWindow = window.open();
				// //是新窗口获得焦点
				// newWindow.focus();
				// //保存写入内容
				// let icontent = document.getElementById("changeNoteView").innerHTML;
				// let newContent = "<html><head><meta charset='utf-8'/><title></title></head><body>"
				// newContent += document.getElementById("changeNoteView").outerHTML;
				// newContent += "</body></html>"
				// // 将HTML代码写入新窗口中
				// newWindow.document.write(newContent);
				// newWindow.print();
				// // close layout stream
				// newWindow.document.close();
				// //关闭打开的临时窗口
				// newWindow.close();
				// document.getElementById("changeNoteView").innerHTML = icontent;


				this.isPrint = true;
				this.isPrintBtn = true;
				this.printPnTimeOut1 = setTimeout(() => {
					window.print();
				}, 2000)

				this.printPnTimeOut2 = setTimeout(() => {
					this.isPrint = false;
					this.isPrintBtn = false;
				}, 3000);

				// window.close();
				return false;
			},

			//生存调查
			showLigfeInv(pageData) {
				let chdrnum = pageData.chdrnum;
				let menuid = "PAS.OPN.INQUIRY.start.1201";

				let username = "";
				let password = "";
				if (sessionStorage.getItem("loginForm")) {
					let loginForm = JSON.parse(sessionStorage.getItem("loginForm"));
					password = loginForm.password;
					username = loginForm.userName;
				}


				let inquiryUrl = uwconstant.inquiryurl + "/loginFromIMPL.do?userid=" + username + "&password=" + password +
					"&chdrnum=" + chdrnum
				// let inquiryUrl = "http://localhost:8080/PAS/loginFromIMPL.do?userid=CHN0001260&password=citicpru1&chdrnum="+chdrnum
				window.open(inquiryUrl);

				let flg = false;
				let procflg = pageData.euaa.procflg;
				pageData.eubas.forEach(euba => {
					if (euba.pncode == "DZ5") {
						if (procflg == "")
							flg = true;
					}
				})
				if (!flg) {
					let index = pageData.eubas.length + 1;
					let euba = {
						applnum: pageData.curApplnum,
						zresnpd: "",
						pntype: "1",
						chdrnum: "",
						memodesc: (pageData.euaa.tsalesunt + uwJs.showTime().substring(2)),
						pndate: pageData.unipndPageList[0].lda_date,
						dateend: "0",
						forceind: "",
						resind: "",
						prtopt: "",
						zprtcert: "",
						reminddate: "0",
						remindflg: "N",
						crtuser: "",
						dtecrt: "0",
						crttime: "0",
						nofday: "0",
						source: "",
						jobName: uwconstant.jobName,
						userProfile: this.userId,
						datime: this.initTime(),
						as_hand: "",
						clntnum: "",
						pncode: "DZ5",
						procflg: "",
						pedesc: "",
						as_pndate: pageData.unipndPageList[0].lda_date,
						rprntdate: "0",
						userid: this.userId,
						pnfrom: this.userId,
						as_dateend: "",
						pncodeBg: "F",
						pedescBg: "F",
						clntnumSelectBg: "B",
						num: index
					}
					pageData.eubas.push(euba);
					this.changePncodeTemp(pageData, euba);
				}

				// this.saveAllInfo();
			},

			//数字字典
			queryCwrs(pageData) {
				let that = this;
				let url = appName.NEWUNDR + '/unipnd/nucleusCwrs/getSecret';
				let res = uwLoadJs.ajaxRequest({}, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					if (res.data.code == "00") {
						//	秘钥信息
						let sign = res.data.sign;
						//	综合查询url地址
						let queryurl = res.data.queryurl;
						//	登录用户工号
						let userCode = res.data.userCode;
						//	登录用户名称
						let userName = res.data.userName;
						//	2、跳转到综合查询
						this.goCwrs(sign, queryurl, userCode, userName, pageData);
					} else {
						that.popMsg(res.data.msg, 'error');
					}
				} else {
					that.popMsg(res.resultMsg, 'error');
				}
			},

			//跳转到综合查询页面
			goCwrs(sign, queryurl, userCode, userName, pageData) {
				let divCustomerNormal = $("#con_four_1"); // 投保人信息div对象
				let display = divCustomerNormal.css("display");

				let id = ""; // 身份证ID
				let cell = ""; // 手机号码
				let name = ""; // 客户姓名
				let bizAddr = ""; // 公司地址
				let homeAddr = ""; // 家庭地址

				if (this.activeName == "first") {
					//	选择了投保人信息
					id = pageData.appBaseInfo.cardno;
					cell = pageData.appBaseInfo.moblie01;
					name = pageData.appBaseInfo.name;
					bizAddr = pageData.appBaseInfo.addr01 + pageData.appBaseInfo.addr02 +
						pageData.appBaseInfo.addr03 + pageData.appBaseInfo.addr04 + pageData.appBaseInfo.addr05;
					homeAddr = bizAddr;

				} else {
					//	选择了被保人信息
					id = pageData.insBaseInfo.cardno;
					cell = pageData.insBaseInfo.moblie01;
					name = pageData.insBaseInfo.name;
					bizAddr = pageData.insBaseInfo.addr01 + pageData.insBaseInfo.addr02 +
						pageData.insBaseInfo.addr03 + pageData.insBaseInfo.addr04 + pageData.insBaseInfo.addr05;
					homeAddr = bizAddr;

				}
				//	中文内容编码
				name = encodeURIComponent(name);
				bizAddr = encodeURIComponent(bizAddr);
				homeAddr = encodeURIComponent(homeAddr);
				userName = encodeURIComponent(userName);

				//	组装url地址
				let url = queryurl + "?sysFrom=S10002&userCode=" + userCode + "&userName=" + userName + "&sign=" + sign +
					"&id=" + id + "&cell=" + cell + "&name=" + name + "&bizAddr=" + bizAddr + "&homeAddr=" + homeAddr;

				if (id == "" || id == undefined ||
					cell == "" || cell == undefined ||
					name == "" || name == undefined ||
					userCode == "" || userCode == undefined ||
					sign == "" || sign == undefined) {
					this.popMsg("客户信息不完整，不能进行数据字典查询操作！", 'error');

				} else {
					window.open(url, '_blank');
				}

			},

			//资料修正
			toEditInfo() {
				this.$router.push({
					path: "/customer/customerInfoIndAdd",
					query: {
						customerNo: this.curPageData.insBaseInfo.clntnum,
						update: 'Y'
					}
				})
			},

			//建档
			toCreateInfo() {
				let that = this;
				// if(that.checkEuaaProcflg(this.curPageData.curApplnum) == false){
				//   that.popMsg("本单已结案或未入账，不能再进行操作 ！！！",'error');
				//   return false;
				// }
				if (this.curPageData.allInfoReadOnly && that.isTBSX) {
					that.popMsg("特别事项入口核决状态不允许修改", 'error');
					return false;
				}


				if (that.pageModifyFlag) {
					this.$confirm('资料尚未存档，是否关闭?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						that.createInfo();
					}).catch(() => {
						return false;
					});
				} else {
					that.createInfo();
				}



			},

			createInfo() {
				let that = this;
				if (!that.checkSessionChange(that.curPageData)) {
					return false;
				}

				let params = {
					"applnum": that.curPageData.curApplnum
				}
				let count = 0;
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/checkAutopayinByApplnum';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					count = res.data;
				} else {
					that.popMsg(res.resultMsg, 'error');
					return false;
				}

				if (count > 0) {
					that.popMsg("该单为autopayin 件,且正在出盘中, 不可进入受理模块", 'error');
					return false;
				}

				that.clearTag();

				let procflg1 = that.check400(that.curPageData.curApplnum);
				if (procflg1 == 4 || procflg1 == 5 || procflg1 == 6) {
					let applnum = that.curPageData.curApplnum;
					let flag = 'N';
					this.$router.push({
						path: '/home/policyRecord/baseInfo' + '/' + applnum + '/' + flag,
						query: {
							pageSource: 'hb'
						}
					}).catch(data => {});
				} else {
					let applnum = that.curPageData.curApplnum;
					let flag = 'Y';
					this.$router.push({
						path: '/home/policyRecord/baseInfo' + '/' + applnum + '/' + flag,
						query: {
							pageSource: 'hb'
						}
					}).catch(data => {});
				}
			},

			clearTag() {
				let that = this;
				let arrs = this.$store.getters['loading/GET_IS_OPEN'];
				let newArrs = [];
				arrs.map((item, index) => {
					if (item == this.applnum) {
						this.$store.dispatch("loading/CHANGE_DEL_ISOPEN", index);
					}
				});

				let activeTag = JSON.parse(sessionStorage.getItem('tagActive'));
				if (activeTag.length > 1) {
					activeTag.map((item, index) => {
						// debugger
						if (item.path == that.$route.path)
							activeTag.splice(index, 1);
					})
				} else if (activeTag.length == 1) {
					activeTag.map((item, index) => {
						// debugger
						if (item.path == that.$route.path && item.path != '/home/taskHome')
							activeTag.splice(index, 1);
					})
				}
				sessionStorage.setItem("tagActive", JSON.stringify(activeTag));
				that.$store.dispatch('setTagActive', activeTag);
			},

			//返回
			back() {
				let that = this;
				this.backTimeOut = setTimeout(function() {
					console.log(that.pageSource)

					// sessionStorage.removeItem(that.applnum);

					//关闭页签
					that.clearTag();


					if (that.pageSource == uwconstant.pages.hebao) {
						that.$router.push({
							path: "/home/taskCenter/newCovenantWordlist/newUnderwritList"
						});
					} else if (that.pageSource == uwconstant.pages.zlxz) {
						that.$router.push({
							path: "/home/taskCenter/newCovenantWordlist/dataModifyList"
						});
					} else if (that.pageSource == uwconstant.pages.tbsx) {
						that.$router.push({
							path: "/home/taskCenter/newCovenantWordlist/specialList"
						});
					} else if (that.pageSource == uwconstant.pages.jd) {
						that.$router.push({
							path: "/home/policyRecord/fileInfolMaintain"
						});
					} else if (that.pageSource == uwconstant.pages.tsrk) {
						// that.$router.push({path:" /underwrite/list"});
						that.$router.go(-1);
					} else if (that.pageSource == uwconstant.pages.hbgzc) {
						// that.$router.replace({path:" /underwrite/newUnderwritList"});
						that.$router.go(-1);
					} else {
						that.$router.go(-1);
					}

				}, 1000);

			},
			//再保意见
			zaibao(item) {
				this.$router.push({
					path: "/home/policyRecord/reinsuranceInfo?chdrnum=" + item.chdrnum
				});
			},

			//撤销核保决定
			cancelAppro(item) {
				let that = this;
				this.$confirm('确定要撤销核保决定?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let params = {
						"applnum": item.curApplnum,
						"approval": item.unipndPageList[0].ls_approval
					}
					that.subUnLoading = true;
					this.cancelApproTimeOut = setTimeout(function() {
						let url = appName.NEWUNDR + '/unipnd/nucleusUpdate/cancelAppro';
						let res = uwLoadJs.ajaxRequest(params, url);
						that.subUnLoading = false;
						if (res == null) {
							return false;
						}
						if (res.resultCode == constant.SUCCESS) {
							if (res.data) {
								item.trailer13.push(res.data);
								that.getIndex = item.trailer13.length - 1;
							}

							item.euaa.procflg = "2";
							item['oldProcflg'] = item.euaa.procflg;
							item.unipndPageList[0].ls_approval = "";
							item['allInfoReadOnly'] = false;
							item['cancelApproval'] = false;
							item.unipndPageList[0].is_uw1on = "N";
							item.euaa.approval = "";
							let euads = [];
							item.trailer4.forEach(euab => {
								euab.approval = "";
								euab['oldapproval'] = "";
								euads.push(euab);
							});
							item.trailer4 = euads;

							let datas = [];
							that.pageData.forEach(page => {
								if (page.curApplnum == item.curApplnum) {
									datas.push(item);
								} else {
									datas.push(page);
								}
							})



							that.pageData = datas;
							that.wfObjectEnable(item, true);
							that.changePolicyConclusions(item);

							that.popMsg(res.resultMsg, 'success');
						} else {
							that.popMsg(res.resultMsg, 'error');
							return false;
						}
						that.subUnLoading = false;
					}, 100)
				}).catch(() => {

				});

			},


			/***************************页面其他操作 END**********************************************/


			/***************************保存操作 START**********************************************/

			fillOtherData(pageData, approval) {
				let _that = this;
				let ls_applnum = pageData.curApplnum;
				let ll_appldate = 0;
				let ls_cnttype = "";
				let ls_clntnum = "";
				ll_appldate = Number(pageData.euaa.as_appldate);
				if (pageData.trailer4 != null) {
					pageData.trailer4.forEach(item => {
						if (item.statFund == "M") {
							ls_cnttype = item.cnttype;
							ls_clntnum = item.clntnum;
						}
					})
				}
				if (ls_cnttype == "VSB" || ls_cnttype == "2VS") {
					pageData.euaa.dateup04 = ll_appldate;
				} else {
					pageData.euaa.dateup04 = pageData.unipndPageList[0].lda_date
				}

				//修改受理主档之处理状况
				//若任一险种之核决为标准体或次标准体 => 检查缴费状况
				if (approval == "S" || approval == "A") {
					if (Number(pageData.euaa.as_instprem) - Number(pageData.euaa.as_payment) > 2000) {
						pageData.euaa.procflg = "4"; //核决
					}
				}

				pageData.euaa.procflg = "4"; //核决
				pageData.euaa.appluser = pageData.unipndPageList[0].userId; //核决人员

				let ajaxvoLl_cltdob8Flag1 = null;
				let ajaxvoIdwHeaderCaldateFlag2 = null;
				let ajaxvoRCDDateFlag3 = null;
				let ajaxvoIdwHeaderNextbdateFlag4 = null;
				let params2 = {
					"clntnum": ls_clntnum,
					"ll_caldate": pageData.euaa.caldate,
					"ls_billfreq": pageData.euaa.billfreq,
					"unipndPageList_lda_date": pageData.unipndPageList[0].lda_date,
					"ls_cnttype": ls_cnttype,
					"applnum": ls_applnum,
					"ll_appldate": ll_appldate
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/decideItemchangedIdwHeaderCaldateNextbDate';
				let res = uwLoadJs.ajaxRequest(params2, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					ajaxvoLl_cltdob8Flag1 = res.data.flag1;
					ajaxvoIdwHeaderCaldateFlag2 = res.data.flag2;
					ajaxvoRCDDateFlag3 = res.data.flag3;
					ajaxvoIdwHeaderNextbdateFlag4 = res.data.flag4;
				}

				if (ajaxvoLl_cltdob8Flag1 != null && ajaxvoLl_cltdob8Flag1 != "") {
					if (ajaxvoIdwHeaderCaldateFlag2 != null && ajaxvoIdwHeaderCaldateFlag2 != "" && pageData.euaa
						.riskType != '续保' && pageData.euaa.riskType != '转投保') {
						pageData.euaa.caldate = pageData.unipndPageList[0].lda_date;
					}
				} else {
					this.popMsg("错误：计算RCD日期时读取资料错误", 'error');
					return false;
				}
				if (pageData.euaa.riskType != '续保' && pageData.euaa.riskType != '转投保') {
					pageData.euaa.nextbdate = ajaxvoIdwHeaderNextbdateFlag4;
				}
				pageData.unipndPageList[0].ls_approval = approval;
				//赋值相同揭露
				let trailer4 = [];
				pageData.trailer4.forEach(item => {

					if (item.statFund == "M") {
						item.polappusr = pageData.unipndPageList[0].userId;
						item.aprvdate = pageData.unipndPageList[0].lda_date;
					}

					item.approval = approval;
					trailer4.push(item);
				})
				pageData.trailer4 = trailer4;
				pageData.euaa.approval = approval;
				pageData.unipndPageList[0].ls_approval = approval;
				pageData.euaa.procflg = "4";



			},

			beforeSaveInfo() {
				//检测一下照会字段是否超长，如果是可编辑的照会，且长度超长，直接打回不让保存并提示---褚四锋
				let isTooLong = false;
				let pncodetmp = "";
				this.curPageData.eubas.forEach(data => {
					data.pedesc = data.pedesc.trimRight();
					if (data.pedesc.length > 124 && !(data.pedescBg == 'RB' || data.pedescBg == 'RR' || data
							.pedescBg == 'RF' || data.pedescBg == 'RG')) {
						pncodetmp = pncodetmp + data.pncode + " ";
						isTooLong = true;
					}
				})
				if (isTooLong) {
					let msg = "注意：" + pncodetmp + " 照会说明过长(超过124个字符)，是否继续保存，确定自动截取，取消返回修改！";
					this.$confirm(msg, '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						//截取长度
						this.curPageData.eubas.forEach(data => {
							if (pncodetmp.indexOf(data.pncode) >= 0) {
								data.pedesc = data.pedesc.substring(0, 124);
							}
						});
						this.saveAllInfoCheck();
					}).catch(() => {

					});
				} else {
					this.saveAllInfoCheck();
				}
			},
			saveAllInfoCheck() {
				let procflg = this.check400(this.curPageData.curApplnum);
				if (procflg == "4") {
					this.popMsg("本单已核决，如需修改，请先进行撤销核保决定操作", 'error');
					return false;
				} else if (procflg == "5" || procflg == "6") {
					this.popMsg("本单已结案或未入账，不能再进行操作 ！！！", 'error');
					return false;
				}
				let euaa_procflg = this.curPageData.euaa.procflg;
				let euaa_approval = this.curPageData.euaa.approval;
				if (((euaa_procflg == '1' || euaa_procflg == '2' || euaa_procflg == '3') && euaa_approval != '') ||
					(euaa_procflg == '4' && euaa_approval == '')) {
					this.popMsg("核保结论与处理状态不匹配,不可保存！！", 'error');
					return false;
				}
				// let params = {
				//   "date":this.curPageData.unipndPageList[0].lda_date
				// }
				// let url = appName.NEWUNDR + '/unipnd/check/checkDate';
				// let res = uwLoadJs.ajaxRequest(params,url);
				if (this.curPageData.euaa.approval && this.curPageData.euaa.approval != "") {
					let lda_date = this.curPageData.unipndPageList[0].lda_date;
					let date400 = this.curPageData.unipndPageList[0].date400;
					console.log(lda_date + ":" + date400)
					if (Number(lda_date) == Number(date400)) {
						this.saveAllInfo();
					} else {
						let msg = "中台服务器的日期和400服务器的日期存在不一致，中台【" + lda_date + "】，400【" + date400 + "】,是否继续?"
						this.$confirm(msg, '提示', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							type: 'warning'
						}).then(() => {
							this.saveAllInfo();
						}).catch(() => {

						});
					}
				} else {
					this.saveAllInfo();
				}

			},
			//保存所有保单信息
			saveAllInfo() {
				let _that = this;
				if (_that.curPageData.allInfoReadOnly == true) {
					_that.popMsg("保单" + _that.curPageData.chdrnum + "不允许修改", 'error');
					return false;
				}

				// _that.subUnLoading = true;
				_that.$store.dispatch('loading/CHANGE_LOADING', true);
				this.saveAllInfoTimeOut = setTimeout(function() {
					console.log("1.保存前校验是否被他人修改")
					if (!_that.checkSessionChange(_that.pageData[0])) {
						_that.subUnLoading = false;
						_that.$store.dispatch('loading/CHANGE_LOADING', false);
						return false;
					}


					let approval = "";
					let newEubas = [];
					let idwTrailer7List = [];
					//结论同其他保单
					console.log("2.保存前校验结论同其他保单" + _that.isSameToOtherPolicy);
					if (_that.isSameToOtherPolicy) {
						console.log("2.1获取当前保单结论")
						_that.pageData.forEach(data => {
							if (_that.curPageData.curApplnum == data.curApplnum) {
								approval = data.euaa.approval;
								_that.curPageData = data;
								idwTrailer7List = data.idwTrailer7List;

								//查找未处理的当天的批注类照会
								for (let i = 0; i < data.eubas.length; i++) {
									let euba = data.eubas[i];
									if (euba.procflg == "" && (euba.zresnpd == "04" || euba.zresnpd ==
											"09") && euba.pndate == data.unipndPageList[0].lda_date) {
										newEubas.push(euba);
									}
								}
							}
						})
						if (approval == "S" || approval == "P" || approval == "D") {
							_that.pageData.forEach(data => {
								if (_that.curPageData.curApplnum != data.curApplnum) {
									console.log("2.2 校验其他保单结论")
									if (data.euaa.approval != "" && data.euaa.approval != approval) {
										_that.popMsg("保单：" + data.euaa.chdrnum + "已选择结论", 'warning');
									} else {
										console.log("2.3 校验其他保单照会处理情况")
										//将照会未核销的自动核销
										let eubas = [];
										for (let i = 0; i < data.eubas.length; i++) {
											let euba = data.eubas[i];
											if (euba.procflg == "") {
												euba.procflg = 'X';
												euba.dateend = data.unipndPageList[0].lda_date
											}
											eubas.push(euba);
										}
										data.eubas = eubas;

										if (approval == "D" || approval == "P") { //延期拒保 ,插入当天未核销的批注类照会
											let eubas1 = [];
											for (let i = 0; i < newEubas.length; i++) {
												let neweuba = newEubas[i];

												data.eubas.push(neweuba);
											}
											let crtable = "";
											data.trailer4.forEach(item => {
												if (item.statFund == "M") {
													crtable = item.crtable;
												}
											})
											idwTrailer7List.forEach(item => {
												let item1 = JSON.parse(JSON.stringify(item));
												item1.crtable = crtable;
												item1.applnum = data.euaa.applnum;
												item1.chdrnum = data.euaa.chdrnum;
												if (approval == "D") { //拒保
													if (item.noteType == "01") {
														data.idwTrailer7List.push(item1);
													}
												} else if (approval == "P") { //延期
													if (item.noteType == "02") {
														data.idwTrailer7List.push(item1);
													}
												} else if (approval == "W") { //取消
													if (item.noteType == "03") {
														data.idwTrailer7List.push(item1);
													}
												}
											})

										}


										if (approval == "S" && _that.ofPendingCheck(data) == -1) {
											_that.popMsg("保单：" + data.euaa.chdrnum + "照会事项未处理完成",
												'warning');
										} else {
											let count = 0;
											data.trailer4.forEach(item => {
												if (item.approval == "" || item.approval ==
													approval) {
													count++;
												}
											})
											console.log("2.4 校验其他保单险种结论")
											if (count != data.trailer4.length) {
												_that.popMsg("保单：" + data.euaa.chdrnum + "已有选择的的险种结论",
													'warning');
											} else {
												console.log("2.5 其他保单赋值为当前险种结论，状态")


												if (data.allInfoReadOnly && _that.isTBSX) {
													_that.popMsg("特别事项入口核决状态不允许修改", 'warning');
													_that.subUnLoading = false;
													_that.$store.dispatch('loading/CHANGE_LOADING', false);
													return false;
												}

												//核保意见
												console.log("2.6 其他保单赋值为当前核保意见")
												let eucm = null;
												_that.curPageData.trailer13.forEach(item => {
													let ll_date = Number(item.effdate);
													let ls_date = Number(_that.curPageData
														.unipndPageList[0].lda_date);
													let userProfile = item.userProfile;

													if (ll_date == ls_date && userProfile == _that
														.userId) {
														eucm = JSON.parse(JSON.stringify(item));
														eucm.applnum = data.euaa.applnum;
													}
												})
												data.trailer13.push(eucm);
												console.log("2.7多保单保存单" + data.curApplnum)
												let flag = _that.savePageData(data);
											}

										}
									}
								} else {
									console.log("多保单保存当前单" + data.curApplnum);
									if (data.allInfoReadOnly && _that.isTBSX) {
										_that.popMsg("特别事项入口核决状态不允许修改", 'warning');
										_that.subUnLoading = false;
										_that.$store.dispatch('loading/CHANGE_LOADING', false);
										return false;
									}


									// let flag = _that.savePageData(data);
									try {
										let flag = _that.savePageData(data);
									} catch (e) {

									}
								}
							})


						}
						_that.subUnLoading = false;
						_that.$store.dispatch('loading/CHANGE_LOADING', false);
						return false;
					} else {
						if (_that.curPageData.allInfoReadOnly && _that.isTBSX) {
							_that.popMsg("特别事项入口核决状态不允许修改", 'warning');
							_that.subUnLoading = false;
							_that.$store.dispatch('loading/CHANGE_LOADING', false);
							return false;
						}
						try {
							let flag = _that.savePageData(_that.curPageData);
							if (!flag) {
								_that.subUnLoading = false;
								_that.$store.dispatch('loading/CHANGE_LOADING', false);
								return false;
							}
						} catch (e) {

							_that.subUnLoading = false;
							_that.$store.dispatch('loading/CHANGE_LOADING', false);
							return false;
						}

					}



					// _that.$message({
					//   message: "保存成功",
					//   type: 'success'
					// });
					_that.subUnLoading = false;
					_that.$store.dispatch('loading/CHANGE_LOADING', false);
					_that.pageModifyFlag = false;
				}, 100);
			},

			savePageData(pageData) {
				let that = this;
				let applnum = pageData.curApplnum;
				let chdrnum = pageData.chdrnum;

				// if(that.pageSource!= uwconstant.pages.tsrk){
				let procflg = that.check400(applnum);
				if (procflg) {
					if (procflg == "4" || procflg == "5" || procflg == "6") {
						that.popMsg("保单" + pageData.chdrnum + "400状态为" + procflg + ",请核实", 'error');
						return false;
					}
				}
				// }
				if (pageData.allInfoReadOnly == true) {
					if (that.pageSource == uwconstant.pages.zlxz || that.pageSource == uwconstant.pages.dzhhf) {
						return false;
					}
					// else if(that.pageSource==uwconstant.pages.tbsx){//特别事项入口
					//         if(pageData.euaa.procflg=="4"){//核决状态
					//           that.popMsg("保单"+pageData.chdrnum+"出盘中，不允许修改",'error');
					//           return false;
					//         }
					//       }

					if (pageData.euaa.procflg == "5" || pageData.euaa.procflg == "6") { //未入账、结案状态，不允许修改
						that.popMsg("保单" + pageData.chdrnum + "未入账或结案状态，不允许修改", 'error');
						return false;
					}
				}

				if (that.checkEuaaProcflg(applnum) == false) {
					that.popMsg("保单" + chdrnum + "已结案或未入账，不能再进行操作 ！！！", 'error');
					return false;
				}



				let idwHeaderDatime = null;
				let idwHeaderUserProfile = null;
				let params = {
					"applnum": applnum
				}
				let change = false;
				let res = uwLoadJs.findEuaapkyByApplnum(params);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					idwHeaderDatime = res.data.datime;
					idwHeaderUserProfile = res.data.userProfile;
				}

				if (idwHeaderDatime == null || idwHeaderDatime.substring(0, 19) != pageData.euaa.datime.substring(0, 19)) {
					that.popMsg("注意:保单" + chdrnum + "已被保存,您不能和其他用户同时操作", 'error');
					return false;
				}

				//检测标准体或次标准体保费是否为0
				if (pageData.euaa.approval == "S" || pageData.euaa.approval == "A" || pageData.euaa.approval == "W") {
					if (Number(pageData.euaa.as_instprem) == 0) {
						let mainCrtable = that.getMainCrtable(pageData);
						//如果只有一个主险，且为AIPC，当保单为转投保的单时，允许保费为0
						if (pageData.trailer4.length == 1 && "AIPC" == mainCrtable && pageData.euaa.riskType == '转投保') {

						} else if ("VSBG" != mainCrtable) { //主险不等于嘉盈未来才提示保费不能为0
							that.popMsg("保单" + chdrnum + "错误信息:标准体或次标准体或取消保费不可为零", 'error');
							return false;
						}
					}
				}

				//如果存在未核销的照会,直接返回
				if (pageData.euaa.approval == "S" || pageData.euaa.approval == "A") {
					if (!that.checkProcflag(pageData)) {
						return false;
					}
				}

				//照会检查
				pageData.eubas.forEach(euba => {
					if (euba.pedesc == "说明:该照会不存在,本单无法保存!") {
						that.popMsg("说明:照会" + euba.pncode + "不存在,本单" + chdrnum + "无法保存!", 'error');
						return false;
					}
					if (euba.pncode == "") {
						that.popMsg("保单" + chdrnum + "错误：照会代码不可为空白", 'error');
						return false;
					}
				})

				//根据A单的状态判断BC单是否允许修改
				let saveflag = that.checkSaveFlagByAStatus(applnum);
				if (saveflag == false) {
					return false;
				}

				//检查是否输入拒保、延期、取消原因
				if (pageData.euaa.approval == "D" || pageData.euaa.approval == "P" || pageData.euaa.approval == "W") {
					let oldList = [];
					pageData.idwTrailer7List.forEach(item => {
						if (pageData.euaa.approval == "D") { //拒保
							if (item.noteType == "01") {
								oldList.push(item);
							}
						} else if (pageData.euaa.approval == "P") { //延期
							if (item.noteType == "02") {
								oldList.push(item);
							}
						} else if (pageData.euaa.approval == "W") { //取消
							if (item.noteType == "03") {
								oldList.push(item);
							}
						}
					})
					if (oldList.length == 0) {
						that.popMsg("保单" + chdrnum + "拒保/延期/取消原因未输入,不得执行保单核决", 'error');
						return false;
					}
				}

				//险种计划核决了部分险种，不是所有险种完成核决，不能保存
				/**let count = 0;
				let count1 = 0;
				pageData.trailer4.forEach(item => {
				  if(item.approval != ""){
				    count++;
				  }
				  if(item.approval == ""){
				    count1++;
				  }
				  // if (item.statFund == "M" && pageData.euaa.approval!="") {
				  //   item.approval = pageData.euaa.approval;
				  // }
				})
				if(count1!=pageData.trailer4.length && count != pageData.trailer4.length){
				  that.popMsg("保单" + chdrnum + "尚有险种未选择核保结论",'error');
				  return false;
				}**/

				//检测核保意见是否为空
				let msgisempty = false;
				let msgmaxLength = false;
				pageData.trailer13.forEach(item => {

					if (item.bmntdesc.trim() == "") {
						msgisempty = true;
					}
					if (item.bmntdesc.length > 1100) {
						msgmaxLength = true;
					}
				})
				if (msgisempty) {
					that.popMsg("保单" + chdrnum + "核保意见不可为空", 'error');
					return false;
				}
				if (msgmaxLength) {
					that.popMsg("保单" + chdrnum + "核保意见长度过长，请重新填写", 'error');
					return false;
				}

				if (that.wfCheckUw(pageData) == 0) {
					that.popMsg("保单" + chdrnum + "错误：没有写核保意见!!!!!!!!,不可处理照会!!!!", 'error');
					that.useDisplay(pageData);
					return false;
				}
				// pageData.trailer13.forEach(item => {
				//         item.bmntdesc  = item.bmntdesc.replace(/\s*/g,"");//清除所有空格

				//       })
				let mmflg = new Array;
				that.initmmflg(mmflg);

				if (that.wfPmPresave(pageData, 1) == -1) {
					that.useDisplay(pageData);
					return false;
				}
				if (that.wfPmPresave(pageData, 2) == -1) {
					that.useDisplay(pageData);
					return false;
				}
				if (that.wfPmPresave(pageData, 3) == -1) {
					that.useDisplay(pageData);
					return false;
				}


				if (pageData.is_calc == "Y") {
					that.wfCalcPrem(pageData, "s");

					//试算成功后修改保险计划的值
					let trailer4Zbinstprem = 0;
					let trailer4Zlinstprem = 0;
					pageData.trailer4.forEach(item => {
						trailer4Zbinstprem += Number(item.zbinstprem);
						trailer4Zlinstprem += Number(item.zlinstprem);
					})
					pageData['allTrailer4ZbZl'] = Number(trailer4Zbinstprem + trailer4Zlinstprem).toFixed(2);
					pageData.is_calc = "N";
				}

				//检查照会核准状况
				if (pageData.appind == "Y") {
					let pnrpdate = that.createPnrpdate(pageData);
					pageData.euaa.pnBackDate = pnrpdate;

					//授权码设定
					that.wfAppindSetting(pageData);
					//照会人员
					pageData.euaa.pnappusr = pageData.unipndPageList[0].userId
					//公司别
					pageData.euaa.flag06 = pageData.unipndPageList[0].userId.substring(1, 2);
					//通讯处列印日期设定为0
					pageData.euaa.rprntdte = "0";
					pageData.euaa.dateup03 = pageData.unipndPageList[0].lda_date; //契约部列印日期设定为系统日期
					//首次照会日期
					if (Number(pageData.euaa.dateup06) == 0) {
						pageData.euaa.dateup06 = pageData.unipndPageList[0].lda_date;
					}
				}

				//照会单位
				if (pageData.euaa.tsalesunt == "") {
					that.popMsg("保单" + chdrnum + "错误：照会单位不可空白", 'error');
					this.useDisplay(pageData);
					return false;
				}

				let lt_time = uwJs.showTime();
				let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				pageData.crtuser = pageData.unipndPageList[0].userId;
				pageData.dtecrt = pageData.unipndPageList[0].lda_date;
				pageData.crttime = ll_time1;
				pageData.userProfile = pageData.unipndPageList[0].userId;
				pageData.jobName = uwconstant.jobName;
				pageData.datime = that.initTime();

				//体检别
				let bflg = null,
					pflg = null,
					prdat = null,
					tpnd = null,
					tflg = null,
					mflg = null;
				for (var i = 0; i < pageData.eubas.length; i++) {
					let euba = pageData.eubas[i];
					if (euba.pntype == "1") {
						if (bflg == "Y") {
							pflg = "";
							prdat = 0;
							pflg = euba.procflg;
							prdat = Number(euba.rprntdate);
							if ((pflg == "X" || pflg == "S" || pflg == "O") && prdat == 0) {
								continue;
							}

							tpnd = euba.pncode.trim();
							tflg = "";
							//如果增加了体检照会在这里改数组的数量即可
							for (var j = 1; j <= 15; j++) {
								if (tpnd == mmflg[j][1]) {
									tflg = mmflg[j][2];
								}
							}
							if (tflg == "M") {
								mflg = tflg;
								bflg = "N";
							} else if (tflg == "O") {
								mflg = tflg;
							} else if (tflg == "R") {
								if (mflg != "O") {
									mflg = tflg;
								}
							}
						}
					}
				}
				if (mflg != "") {
					pageData.mmflg = mflg;
				}

				//首次核保日期/首次核保人员
				if (pageData.euaa.approval == "S" || pageData.euaa.approval == "A") {
					if (pageData.euaa.firstApplDate == "0" || pageData.euaa.firstApplDate == "" || pageData.euaa
						.firstApplDate == "99999999") {
						// pageData.euaa.appldate = pageData.unipndPageList[0].lda_date;//首次核保日期
						pageData.euaa.firstApplDate = pageData.unipndPageList[0].lda_date; //首次核保日期
					}
					if (pageData.euaa.firstApplUser == "0" || pageData.euaa.firstApplUser == "") {
						pageData.euaa.appluser = pageData.unipndPageList[0].userId; //首次核保人员
						pageData.euaa.firstApplUser = pageData.unipndPageList[0].userId; //首次核保人员
					}
				}
				pageData.euaa.businessDate = pageData.unipndPageList[0].lda_date;

				let oldList = [];
				pageData.trailer4.forEach(item => {
					if (item.approval == "D") { //拒保
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "01") {
								oldList.push(note);
							}
						})
					} else if (item.approval == "P") { //延期
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "02") {
								oldList.push(note);
							}
						})
					} else if (item.approval == "W") { //取消
						pageData.idwTrailer7List.forEach(note => {
							if (note.crtable == item.crtable && note.noteType == "03") {
								oldList.push(note);
							}
						})
					}
				})

				//核保结论同其他单
				if (that.isSameToOtherPolicy) {
					let approval = "";
					that.pageData.forEach(data => {
						if (that.curPageData.curApplnum == data.curApplnum) {
							approval = data.euaa.approval;
						}
					})
					if (approval == "S" || approval == "P" || approval == "D") {
						//不是当前单，填充数据
						if (that.curPageData.curApplnum != pageData.curApplnum) {
							console.log("不是当前单，填充数据");
							that.fillOtherData(pageData, approval);

							if (approval == "P" || approval == "D") {
								oldList = [];
								pageData.trailer4.forEach(item => {
									if (item.approval == "D") { //拒保
										pageData.idwTrailer7List.forEach(note => {
											if (note.crtable == item.crtable && note.noteType == "01") {
												oldList.push(note);
											}
										})
									} else if (item.approval == "P") { //延期
										pageData.idwTrailer7List.forEach(note => {
											if (note.crtable == item.crtable && note.noteType == "02") {
												oldList.push(note);
											}
										})
									} else if (item.approval == "W") { //取消
										pageData.idwTrailer7List.forEach(note => {
											if (note.crtable == item.crtable && note.noteType == "03") {
												oldList.push(note);
											}
										})
									}
								})
							}

						}
					}
				}

				let appind = pageData.appind;
				if (pageData.euaa.approval && (pageData.euaa.approval == "D" || pageData.euaa.approval == "P")) {
					if (pageData.appind && pageData.appind == "Y") {
						appind = "";
					}
				}

				let flag = false;
				let data = {
					"applnum": applnum,
					"pageSource": that.pageSource,
					"userId": that.userId,
					"approval": pageData.euaa.approval,
					"appind": appind,
					"idwHeaderVO": JSON.stringify(pageData.euaa),
					"eubas": JSON.stringify(pageData.eubas), //照会
					"idwTrailer13": JSON.stringify(pageData.trailer13), //核保意见
					"idwTrailer4": JSON.stringify(pageData.trailer4), //保险计划
					"idwTrailer7List": JSON.stringify(oldList) //拒保延期
				}
				//被保险人的费率数值，页面可能做了修改，有值就需要回写
				if (pageData.insBaseInfo.flag03) {
					data["flag03"] = pageData.insBaseInfo.flag03;
				}
				let url1 = appName.NEWUNDR + '/unipnd/nucleusUpdate/saveAllInfo';
				let res1 = uwLoadJs.ajaxRequest(data, url1);
				// let res1 = {};
				// res1.resultCode = constant.SUCCESS;
				// res1.resultMsg = "保存成功";

				if (res1 == null) {
					that.popMsg("受理号" + applnum + "保存失败", 'error');
					return false;
				}

				if (res1.data != null) {
					pageData.euaa.lastUpdateTime = res1.data;
					pageData.euaa.datime = res1.data;
				}
				if (res1.resultCode == constant.SUCCESS) {
					if (pageData.appind == "Y") {
						// that.send003Message(pageData);
					}

					//核决后不允许操作
					if (pageData.euaa.approval != "" && pageData.euaa.procflg == "4") {
						pageData['allInfoReadOnly'] = true;
						pageData['cancelApproval'] = true;
					}

					pageData.appind = "N";
					that.useDisplay(pageData);
					that.initAugument(pageData);
					that.setData(pageData);
					that.pageModifyFlag = false;

					let sucMsg = "受理号" + applnum + "保存成功";
					if ("保存成功" == res1.resultMsg) {
						that.popMsg(sucMsg, 'success');
					} else {
						that.popMsg(res1.resultMsg != "" ? res1.resultMsg : sucMsg, 'success');
					}
					this.savePageDataTimeOut = setTimeout(() => {

						this.saveCompareData();
						let obj = {};
						obj.isChange = false;
						obj.msg = '';
						this.$store.dispatch('setHebaoDataChange', obj)
						console.log('修改setHebaoDataChange')
						console.log(obj)
					}, 200)
					flag = true;
				} else {
					that.popMsg(res1.resultMsg != "" ? res1.resultMsg : "保存失败", 'error');
					if (res1.resultMsg.indexOf("请手工进行任务流转") != -1) {
						//核决后不允许操作
						if (pageData.euaa.approval != "" && pageData.euaa.procflg == "4") {
							pageData['allInfoReadOnly'] = true;
							pageData['cancelApproval'] = true;
							pageData.appind = "N";
							that.useDisplay(pageData);
							that.initAugument(pageData);
							that.setData(pageData);
							that.pageModifyFlag = false;
						}
					}
					flag = false;
				}
				this.subtractPD();
				return flag;
			},
			initmmflg(mmflg) {
				//如果增加了体检照会在这里改数组的数量即可
				for (let i = 1; i <= 15; i++) {
					mmflg[i] = new Array;
				}
				mmflg[1][1] = "M01";
				mmflg[1][2] = "M";
				mmflg[2][1] = "M02";
				mmflg[2][2] = "R";
				mmflg[3][1] = "M03";
				mmflg[3][2] = "O";
				mmflg[4][1] = "M04";
				mmflg[4][2] = "O";
				mmflg[5][1] = "M05";
				mmflg[5][2] = "O";
				mmflg[6][1] = "M06";
				mmflg[6][2] = "O";
				mmflg[7][1] = "M09";
				mmflg[7][2] = "O";
				mmflg[8][1] = "M13";
				mmflg[8][2] = "M";
				mmflg[9][1] = "MY1";
				mmflg[9][2] = "M";
				mmflg[10][1] = "M10";
				mmflg[10][2] = "M";
				mmflg[11][1] = "M16";
				mmflg[11][2] = "M";
				mmflg[12][1] = "M17";
				mmflg[12][2] = "M";
				mmflg[13][1] = "M18";
				mmflg[13][2] = "M";
				mmflg[14][1] = "M19";
				mmflg[14][2] = "M";
				mmflg[15][1] = "M20";
				mmflg[15][2] = "M";
			},

			//获取主险险种代码
			getMainCrtable(pageData) {
				let mainCrtable = "";
				pageData.trailer4.forEach(item => {
					if (item.statFund == "M") {
						mainCrtable = item.crtable;
					}
				})

				return mainCrtable;
			},
			//当核保决定为标准体和次标准体时，检测是否填写照会处理码
			checkProcflag(pageData) {
				//检测结果
				let ret = true;
				for (let i = 0; i < pageData.eubas.length; i++) {
					let euba = pageData.eubas[i];
					if (euba.procflg == "") {
						ret = false;
						break;
					}
				}

				if (!ret) {
					this.popMsg("错误：请先处理完 未核销的照会 再进行保存！", 'error');
					return ret;
				}
				return ret;
			},
			//根据A单的状态判断BC单是否允许修改
			checkSaveFlagByAStatus(applnum) {
				let that = this;
				let message = null;
				let checkFlag = true;
				let params = {
					"applnum": applnum
				}

				let url = appName.NEWUNDR + '/unipnd/nucleusNote/checkSaveFlagByAStatus';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					message = res.data;
					if (message == "success") {
						checkFlag = true;
					} else {
						that.popMsg(message, 'error');
						checkFlag = false;
					}
				} else {
					checkFlag = true;
				}
				return checkFlag;
			},
			//保费试算
			/**
			 * @param {Object} pageData 当前保单对象
			 * @param {Object} sign 控制是加费还是加费除外的弹框
			 * @param {Object} type 是选择险种加费或者加费除外亦或是其他的 1加费 2加费除外
			 * @param {Object} rate 费率档位标志位 默认为rate
			 * @param {Object} flag03 费率值，需要传入后台实时计算，且需要压档
			 */
			wfCalcPrem(pageData, sign, type, rate, flag03) {
				this.callPremType = type;
				this.callPremSign = sign;
				let ls_billfreq = pageData.euaa.billfreq;
				let ls_campaign = pageData.euaa.campaign;
				let ll_effdate = pageData.euaa.as_effdate;
				if (!this.fCalPrem(pageData, this.callPremType, flag03)) {
					return false;
				}
				//不是加费试算的情况
				if (this.callPremType != 1 && this.callPremType != 2) {
					if (rate != "rate") {
						this.openPremium(this.curAddPremData, this.curAddPremObj, sign);
					}
					this.callPremSign = null;
					this.callPremType = null;
					// fCalPrem(ls_billfreq, ll_effdate, ls_campaign, ll_instprem, ll_zbinstprem, ll_zlinstprem);
					let ll_instprem = this.wfSetfirstprem(pageData);

					let ls_pol1 = pageData.euaa.as_pol1;
					let ls_pol2 = pageData.euaa.as_pol2;
					let ls_pol3 = pageData.euaa.as_pol3;

					if (ls_pol1 == null || ls_pol1 == "") {
						pageData.euaa.as_instprem = Number(ll_instprem);
						this.setData(pageData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						pageData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol1.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}

					if (ls_pol2 == null || ls_pol2 == "") {
						pageData.euaa.as_instprem = Number(ll_instprem);
						this.setData(pageData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						pageData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol2.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}
					if (ls_pol3 == null || ls_pol3 == "") {
						pageData.euaa.instprem = Number(ll_instprem);
						this.setData(pageData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						pageData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol3.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}
					this.callPremType = null;
					pageData.euaa.as_instprem = Number(ll_instprem).toFixed(2);
					pageData.euaa.as_payment = Number(pageData.euaa.as_payment).toFixed(2) - Number(ll_instprem).toFixed(
					2);
					this.setData(pageData);
				}
				return true;
			},
			//调用后台保费计算接口
			fCalPrem(pageData, type, flag03) {
				this.callPremEuahs = [];
				let that = this;
				let url = appName.NEWUNDR + '/unipnd/premium/findEutdpfByApplnum';
				pageData.trailer4.forEach(item => {
					let params = {
						"applnum": item.applnum,
						"userId": this.userId,
						"chdrnum": item.chdrnum,
						"clntnum": item.clntnum,
						"polpln": item.polpln,
					}
					let res = uwLoadJs.ajaxRequest(params, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						res.data.forEach(item => {
							this.callPremEuahs.push(item);
						})
					}
				})
				let params = {
					"euaa": JSON.stringify(pageData.euaa),
					"euab": JSON.stringify(pageData.trailer4),
					"euah": JSON.stringify(this.callPremEuahs),
				}
				if (flag03) {
					params["flag03"] = flag03;
				}
				let url1 = appName.NEWUNDR + '/unipnd/premiumCal/calculation';
				let res = uwLoadJs.ajaxRequest(params, url1);
				if (res == null) {
					return false;
				}
				if (res.data != null) {
					console.log(res.data)
					this.callPremBase = res.data;
					this.callPremEuabs = res.data.planResponseInfoList;
					// that.$message({
					//   message: "试算成功!",
					//   type: 'success'
					// });
				} else {
          if (res.resultMsg) {
            that.popMsg(res.resultMsg, 'error');
          } else {
            that.popMsg("保费计算失败", 'error');
          }
					return false;
				}
				//更新明细
				if (this.callPremEuabs.length > 0) {
					this.callPremEuabs.forEach(euab => {
						if (euab.instpremList != null && euab.instpremList.length > 0) {
							euab.instpremList.forEach(eutdVo => {
								this.callPremEuahs.forEach(euah => {
									// 更新明细根据[险种+加费类别序号]条件执行
									if (euah.seqnbr == eutdVo.seqnbr && euah.polpln == eutdVo
										.polpln) {
										let params1 = {
											"applnum": euah.applnum,
											"chdrnum": euah.chdrnum,
											"clntnum": euah.clntnum,
											"polpln": euah.polpln,
											"seqnbr": euah.seqnbr,
											"remark02": this.userId,
											"zlinstprem": eutdVo.zlinstprem //次标加费,
										}
										let url2 = appName.NEWUNDR +
											'/unipnd/premium/updatePremiumTempWithCalc';
										let res2 = uwLoadJs.ajaxRequest(params1, url2);
									}
								})

							})
						}
					})
				}
				if (this.callPremType != 1 && this.callPremType != 2) {
					if (this.callPremBase != null) {
						// pageData.euaa. = base.alInstpremTot;//总保费
						pageData.euaa.zbinstpremTotal = this.callPremBase.alZbinstpremTot; //总基本保费
						pageData.euaa.zlinstpremTotal = this.callPremBase.alZlinstpremTot; //总次标保费
						pageData.euaa.firstpremTotal = this.callPremBase.firstpremTotal; //首期保费总合
						pageData.instpremTotal = this.callPremBase.alInstpremTot;
						pageData.firstpremTotal = this.callPremBase.firstpremTotal;
					}
					if (this.callPremEuabs.length > 0) {
						let datas = [];
						pageData.trailer4.forEach(item => {
							this.callPremEuabs.forEach(euab => {
								if (euab.polpln == item.polpln) {
									item.sumins = euab.sumins; //保额
									item.zlinstprem = euab.zlinstprem; //次标保费
									item.zbinstprem = euab.zbinstprem; //基本保费
									item.instprem = euab.instprem; //总保费
								}
							})
							datas.push(item);
						})
						pageData.trailer4 = datas;
					}
					this.callPremBase = null;
					this.callPremEuabs = [];
					this.callPremEuahs = [];
					this.setData(pageData);
				} else {
					this.curAddPremObj['isTryAdd'] = 'Y'
				}
				return true;
			},
			/* 只有加费和加费除外的确定才能进入，当点击确定加费按钮后才触发设置页面上的保费数据刷新*/
			setAddPrem() {
				if (this.callPremType == 1 || this.callPremType == 2) {
					if (this.callPremEuabs.length > 0) {
						this.callPremEuabs.forEach(euab => {
							if (euab.instpremList != null && euab.instpremList.length > 0) {
								euab.instpremList.forEach(eutdVo => {
									this.callPremEuahs.forEach(euah => {
										// 更新明细根据[险种+加费类别序号]条件执行
										if (euah.seqnbr == eutdVo.seqnbr && euah.polpln == eutdVo
											.polpln) {
											let params1 = {
												"applnum": euah.applnum,
												"chdrnum": euah.chdrnum,
												"clntnum": euah.clntnum,
												"polpln": euah.polpln,
												"seqnbr": euah.seqnbr,
												"remark02": this.userId,
												"zlinstprem": eutdVo.zlinstprem //次标加费,
											}
											let url2 = appName.NEWUNDR +
												'/unipnd/premium/updatePremiumTempWithCalc';
											let res2 = uwLoadJs.ajaxRequest(params1, url2);
										}
									})

								})
							}
						})
					}
					if (this.callPremBase != null) {
						// pageData.euaa. = base.alInstpremTot;//总保费
						this.curAddPremData.euaa.zbinstpremTotal = this.callPremBase.alZbinstpremTot; //总基本保费
						this.curAddPremData.euaa.zlinstpremTotal = this.callPremBase.alZlinstpremTot; //总次标保费
						this.curAddPremData.euaa.firstpremTotal = this.callPremBase.firstpremTotal; //首期保费总合
						this.curAddPremData.instpremTotal = this.callPremBase.alInstpremTot;
						this.curAddPremData.firstpremTotal = this.callPremBase.firstpremTotal;
					}
					if (this.callPremEuabs.length > 0) {
						let datas = [];
						this.curAddPremData.trailer4.forEach(item => {
							this.callPremEuabs.forEach(euab => {
								if (euab.polpln == item.polpln) {
									item.sumins = euab.sumins; //保额
									item.zlinstprem = euab.zlinstprem; //次标保费
									item.zbinstprem = euab.zbinstprem; //基本保费
									item.instprem = euab.instprem; //总保费
								}
							})
							datas.push(item);
						})
						this.curAddPremData.trailer4 = datas;
					}
					this.setData(this.curAddPremData);
					//清除临时变量
					this.callPremBase = null;
					this.callPremEuabs = [];
					this.callPremEuahs = [];
					this.callPremType = null;
					this.callPremSign = null;
					this.curAddPremObj['isTryAdd'] = 'N'
					this.curAddPremObj['premList'] = [];
					this.openPremium(this.curAddPremData, this.curAddPremObj, this.callPremSign);
					let ll_instprem = this.wfSetfirstprem(this.curAddPremData);
					let ls_pol1 = this.curAddPremData.euaa.as_pol1;
					let ls_pol2 = this.curAddPremData.euaa.as_pol2;
					let ls_pol3 = this.curAddPremData.euaa.as_pol3;

					if (ls_pol1 == null || ls_pol1 == "") {
						this.curAddPremData.euaa.as_instprem = Number(ll_instprem);
						this.setData(this.curAddPremData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						this.curAddPremData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol1.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}

					if (ls_pol2 == null || ls_pol2 == "") {
						this.curAddPremData.euaa.as_instprem = Number(ll_instprem);
						this.setData(this.curAddPremData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						this.curAddPremData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol2.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}
					if (ls_pol3 == null || ls_pol3 == "") {
						this.curAddPremData.euaa.instprem = Number(ll_instprem);
						this.setData(this.curAddPremData);
						return false;
					} else {
						//拒保,延期,取消须扣除HEADER之应缴总保费
						this.curAddPremData.trailer4.forEach(item => {
							if (item.approval == "D" || item.approval == "P") {
								if (ls_pol3.trim() == item.chdrnum) {
									ll_instprem = ll_instprem - Number(item.instprem);
								}
							}
						})
					}
					this.curAddPremData.euaa.as_instprem = Number(ll_instprem).toFixed(2);
					this.curAddPremData.euaa.as_payment = Number(pageData.euaa.as_payment).toFixed(2) - Number(ll_instprem)
						.toFixed(2);
					this.setData(this.curAddPremData);

				}
			},
			//重新赋值
			setData(pageData) {
				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == pageData.curApplnum) {
						datas.push(pageData);
					} else {
						datas.push(item);
					}
				})
				this.pageData = datas;
			},
			/****************************
			 * 投保计划列表中操作“险种核保结论”选项时重新计算：“保费合计”及“首期保费合计”
			 *
			 ****************************/
			recalculateFee(pageData) {
				let culChdrnum = pageData.chdrnum; // 当前保单号
				let culInstpremTotal = 0; // 需要扣除的总保费
				//拒保,延期,取消须扣除[标准保费+加费金额]
				pageData.trailer4.forEach(item => {
					if (item.approval == "D" || item.approval == "P" || item.approval == "W") {
						if (culChdrnum == item.chdrnum) {
							culInstpremTotal = culInstpremTotal + Number(item.zbinstprem); // 标准保费：zbinstprem
							culInstpremTotal = culInstpremTotal + Number(item.zlinstprem); // 加费金额：zlinstprem
						}
					}
				})
				// 赋值改变
				pageData.instpremTotal = pageData.instpremTotal - culInstpremTotal;
				pageData.firstpremTotal = pageData.firstpremTotal - culInstpremTotal;
			},
			wfSetfirstprem(pageData) {
				let that = this;
				let ll_caldate = 0,
					ll_appldate = 0;
				let li_relmonth = 0,
					li_multi = 0;
				let ls_billfreq = null;
				let ld_prem = 0,
					ld_firstprem = 0,
					ld_total = 0;
				ll_appldate = Number(pageData.euaa.as_appldate);
				ll_caldate = Number(pageData.euaa.caldate);
				ls_billfreq = pageData.euaa.billfreq;

				if (ls_billfreq == "00" || ls_billfreq == "01" || ls_billfreq == "02") {
					li_multi = 1;
				} else if (ls_billfreq == "04") {
					let params = {
						"ll_caldate": ll_caldate,
						"ll_appldate": ll_appldate
					}
					let res = uwLoadJs.fGetrelmonth(params);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						li_relmonth = Number(res.data);
					}

					if (li_relmonth > 1) {
						li_multi = 2;
					} else {
						li_multi = 1;
					}
				} else if (ls_billfreq == "12") {
					let params = {
						"ll_caldate": ll_caldate,
						"ll_appldate": ll_appldate
					}
					let res = uwLoadJs.fGetrelmonth(params);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						li_relmonth = Number(res.data);
					}
					li_multi = li_relmonth + 2;
				}

				ld_total = 0;

				let tArr = [];
				pageData.trailer4.forEach(item => {
					ld_prem = Number(item.instprem);
					ld_firstprem = ld_prem * li_multi;
					item.firstprem = ld_firstprem
					ld_total = ld_total + ld_firstprem;

					tArr.push(item);
				})
				pageData.trailer4 = tArr;


				return ld_total;
			},
			//修改授权列印为Y
			wfAppindSetting(pageData) {
				pageData.eubas.forEach(euba => {
					euba.zprtcert = "Y";
				})
			},

			//发送绿色通道短信
			send003Message(pageData) {
				let that = this;
				let ls_applnum = pageData.curApplnum;
				let ls_flag16 = "";
				let ls_aagtnum = "";
				let ls_agntname01 = "";
				let ls_srcebus = "";
				let ls_phone = "";
				let params = {
					"applnum": ls_applnum
				}

				let res = uwLoadJs.findEuaapkyByApplnum(params);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					ls_flag16 = res.data.flag16;
					ls_aagtnum = res.data.agntnum01;
					ls_agntname01 = res.data.agntname01;
					ls_srcebus = res.data.srcebus;
				}

				if (ls_srcebus == "AG" || ls_srcebus == "BK") {
					let li_ii = 0;
					for (var i = 0; i < pageData.eubas.length; i++) {
						let ls_zresnpd = pageData.eubas[i].zresnpd;
						let ls_procflg = pageData.eubas[i].procflg;
						let ll_pndate = pageData.eubas[i].as_pndate;
						if (ls_procflg.length == 0 && ls_zresnpd != "06" && ls_zresnpd != "20" && ll_pndate == pageData
							.unipndPageList[0].lda_date) {
							li_ii = 1;
							break;
						}
					}

					if (li_ii == 1) {
						let ls_rmblphone = "";
						let ls_phone1 = "";
						let ls_phone2 = "";

						let params1 = {
							"aagtnum": ls_aagtnum
						}

						let res = uwLoadJs.findRmblphoneFromCA(params1);
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							ls_rmblphone = res.data.RMBLPHONE != "" ? res.data.RMBLPHONE.trim() : "";
						}

						if (ls_rmblphone == "") {
							let res1 = uwLoadJs.findPhoneFromCA(params1);
							if (res1.resultCode == constant.SUCCESS && res1.data != null) {
								ls_phone1 = res1.data.cltphone01;
								ls_phone2 = res1.data.cltphone02;
							}
						}


						if (ls_rmblphone == "") {
							if (ls_phone1 == "" && ls_phone2 == "") {
								this.popMsg("代理人:" + ls_aagtnum + "没有设置手机号码，无法发送短信!", 'error');
							} else {
								if (ls_phone2.length == 0) {
									ls_phone = ls_phone1.trim();
								} else {
									ls_phone = ls_phone2.trim();
								}
							}
						} else {
							ls_phone = ls_rmblphone.trim();
						}
					}

					if (ls_phone != null && ls_phone.length != 0) {
						let ls_ownname = "";
						let params2 = {
							"applnum": ls_applnum
						}

						let url2 = appName.NEWUNDR + '/unipnd/nucleusNote/findEuadByApplnum';
						let res2 = uwLoadJs.ajaxRequest(params2, url2);
						if (res2 == null) {
							return false;
						}
						if (res2.resultCode == constant.SUCCESS && res2.data != null) {
							ls_ownname = res2.data.surname
						}


						if (ls_ownname.length == 0) {
							this.popMsg("获取投保人姓名出错，无法发送短信!", 'error');
						} else {
							let params3 = {
								"chdrnum": pageData.euaa.as_pol1,
								"agntname01": ls_agntname01,
								"ownname": ls_ownname,
								"phone": ls_phone,
								"surname": pageData.euaa.as_life,
							}
							let url3 = appName.NEWUNDR + '/unipnd/nucleusUpdate/send003Message';
							let res3 = uwLoadJs.ajaxRequest(params3, url3);
							if (res3 == null) {
								return false;
							}
							if (res3.resultCode == constant.SUCCESS && res3.data != null) {
								if (res3.data == "0") {
									that.popMsg("发送短信失败，请重试!", 'error');
								}
							}

						}
					}
				}

			},

			initAugument(pageData) {
				pageData.is_uwlevel = "N";
				pageData.is_uwflag = "N";
				pageData.is_uwauth = "N";
				pageData.is_dangflag = "N";
				pageData.ls_appind = null;
				pageData.is_save_uw = "Y";
				pageData.is_upd = "N";
				pageData.is_calc = "N";
				pageData.is_RULtimes = "N";
				pageData.is_indexflag = "N";
				pageData.is_currlife = "";
			},
			//检查处理状态是否结案
			checkEuaaProcflg(applnum) {
				let result = true;
				let that = this;

				let procflg = null;
				let params = {
					"applnum": applnum
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/findProcflgFromEuaapky';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					procflg = res.data;
				}
				if (procflg == "6" || procflg == "5") {
					result = false;
				}

				return result;
			},
			/***************************保存操作 END**********************************************/




			/***************************页面初始化 BEGIN**********************************************/

			fillData(res) {
				let that = this;
				that.pageData = res.data;
				console.log("1.获取初始化数据：");
				console.log(that.pageData);

				//异步初始化头部信息
				let data = that.pageData[0];
				that.lda_date = data.unipndPageList[0].lda_date;
				that.userId = data.unipndPageList[0].userId;

				//vip信息
				that.showVip(data);

				that.curPageData = data;

				let datas = [];
				that.pageData.forEach(ply => {
					let as_dyj = Number(ply.euaa.as_payment) - Number(ply.euaa.as_instprem);
					ply.euaa['as_dyj'] = Number(as_dyj).toFixed(2);
					ply.euaa.as_instprem = Number(ply.euaa.as_instprem).toFixed(2);
					ply.euaa['oldapproval'] = ply.euaa.approval;
					//计算保费
					let firstpremTotal = 0;
					let instpremTotal = 0;
					let euads = [];
					ply.trailer4.forEach(item => {
						if (item.approval != 'D' && item.approval != 'P') {
							//首期保费 firstprem
							firstpremTotal += Number(item.firstprem);
							//保费合计 instprem
							instpremTotal += Number(item.instprem);
						}
						//已缴保费
						item['oldapproval'] = item.approval;
						euads.push(item);
					});
					ply.trailer4 = euads;


					ply['firstpremTotal'] = firstpremTotal;
					ply['instpremTotal'] = instpremTotal;
					ply['appind'] = ""; //核准项


					//资料修正入口 待照会回复 再保处理 集汇件
					if (that.pageSource == uwconstant.pages.zlxz || that.pageSource == uwconstant.pages.dzhhf) {
						ply['allInfoReadOnly'] = true;
					} else if (that.pageSource == uwconstant.pages.tbsx) { //特别事项入口
						that.isTBSX = true;
						if (ply.euaa.procflg == "1" || ply.euaa.procflg == "2" || ply.euaa.procflg ==
							"3") { //建档、核保、照会状态
							ply['allInfoReadOnly'] = false;
						} else if (ply.euaa.procflg == "4") { //核决状态
							ply['allInfoReadOnly'] = true;
							//that.popMsg("保单"+ply.chdrnum+"出盘中，不允许修改",'error');
							let count = 0;
							let url = appName.NEWUNDR + '/unipnd/nucleusNote/checkAutopayinByApplnum';
							let res = uwLoadJs.ajaxRequest(params, url);
							if (res.resultCode == constant.SUCCESS && res.data != null) {
								count = res.data;
							}
							if (count > 0) {
								//that.popMsg("该单为autopayin 件,且正在出盘中, 不可进入受理模块",'error');
								that.popMsg("保单" + ply.chdrnum + "出盘中，不允许修改", 'error');
							}
						} else if (ply.euaa.procflg == "5" || ply.euaa.procflg == "6") { //未入账、结案状态，不允许修改
							ply['allInfoReadOnly'] = true;
						} else {
							ply['allInfoReadOnly'] = false;
						}
					} else {
						ply['allInfoReadOnly'] = false;
					}

					if (ply.euaa.procflg == "5" || ply.euaa.procflg == "6") { //未入账、结案状态，不允许修改
						ply['allInfoReadOnly'] = true;
					}

					//核准权限
					let pnflag = false;
					if (ply.eufgpkyVO.pnflag != "Y") {
						pnflag = true;
					}
					ply['pnflag'] = pnflag; //
					ply['pnAddDis'] = false; //照会新增权限
					ply['pnDelDis'] = false; //照会删除权限
					ply['is_uwlevel'] = "N";
					ply['is_uwauth'] = "N";
					ply['is_uwflag'] = "N";
					ply['is_dangflag'] = "N";
					ply['is_indexflag'] = "N";
					ply['is_calc'] = "N";
					ply['oldProcflg'] = ply.euaa.procflg;
					ply['as_pnBackDate'] = ply.euaa.pnBackDate;
					ply.euaa['as_agntname01'] = ply.euaa.agntname01 + "/" + ply.euaa.agtydesc01;
					ply.euaa['tsalesdsc1'] = ply.euaa.tsalesunt + "/" + ply.euaa.tsalesdsc;
					ply['isSameToOther'] = true;
					ply['isSameToOtherPolicy'] = false;

					//整单核保结论
					// that.changePolicyConclusions(ply);
					that.initPolicyConclusions(ply);

					datas.push(ply);
				});

				that.pageData = datas;
				console.log("init finished.....")
				console.log("2.数据初始化完成" + that.pageData)

				if (that.pageSource == uwconstant.pages.zlxz || that.pageSource == uwconstant.pages.dzhhf) {
					that.allInfoReadOnly = true;
				}

				//初始化照会背景颜色
				that.initEubaBg();

				that.$store.dispatch('loading/CHANGE_IS_OPEN', that.applnum);
			},

			//处理双击事件进行核保
			doUwClick() {
				let that = this;
				let time = 45000;
				if (this.applnum == "") {
					return false;
				} else {
					if (this.applnum.indexOf("_") > 0) {
						let arr = this.applnum.split("_");
						time = Number(time) * Number(arr.length);
					}

				}
				let isRelSource = Number(uwconstant.pagesources.indexOf(this.pageSource));
				console.log(isRelSource)
				if (this.pageSource == null || this.pageSource == undefined || isRelSource < 0) {
					this.popMsg("页面不明传参", 'error');
					this.back();
					return false;
				}
				let para = {
					"applnum": this.applnum, //受理号
					"pageSource": this.pageSource //页面来源
				}

				// that.subUnLoading = true;
				that.$store.dispatch('loading/CHANGE_LOADING', true);
				this.doUwClickTimeOut = setTimeout(function() {
					// that.requestInit(para);
					that.doubleClick(para, time);
				}, 100);



			},

			doubleClick(para, time) {
				let that = this;
				let message = "";
				doubleClick(para).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						if (res.data.datas != null) {
							let params = [];
							let goPage = null;
							res.data.datas.forEach(item => {
								let checkStatus = item.checkStatus;
								if (checkStatus == constant.SUCCESS) {
									message = res.resultMsg;
								} else {
									goPage = item.goPage;
									if ("goPage" == goPage) {
										message = res.resultMsg;
									}
									let lstr_parm = null;
									if (item.lstr_parm) {
										lstr_parm = item.lstr_parm;
									}
									let pn = {
										"applnum": item.applnum,
										"appltype": item.appltype,
										"chdrnum": item.chdrnum,
										"invFlag": item.invFlag,
										"option": item.option,
										"eufgpkyVO": JSON.stringify(item.eufgpkyVO),
										"lstr_parm": JSON.stringify(lstr_parm)
									};
									params.push(pn);
									console.log(res.resultMsg)
								}
							})

							if (params.length == 0) {
								that.$message({
									dangerouslyUseHTMLString: true,
									type: 'error',
									message: res.resultMsg,
									duration: 15000,
									showClose: true,
								});
								that.$store.dispatch('loading/CHANGE_LOADING', false);
								that.back();
							} else {
								if (message != "") {
									if (goPage == "goPage") {
										that.$message({
											dangerouslyUseHTMLString: true,
											message: message,
											type: "success",
											duration: 15000,
											showClose: true,
										});
									} else {
										that.$message({
											dangerouslyUseHTMLString: true,
											message: message,
											type: "error",
											duration: 15000,
											showClose: true,
										});
									}
								}

							}

							if (params.length > 0) {
								that.initUwPage(params, time);
							}
						}

					} else {
						/*Message({
							message: res.resultMsg,
							type: 'error',
							duration: 15000,
							showClose: true,
						});*/
						// that.popMsg(res.resultMsg,'error');
						that.$store.dispatch('loading/CHANGE_LOADING', false)
						that.back();
						that.subUnLoading = false;
					}
				}).catch(err => {
					Message({
						message: message,
						type: 'error',
						duration: 15000,
						showClose: true,
					});
					that.popMsg(err.message, 'error');
					that.$store.dispatch('loading/CHANGE_LOADING', false)
					that.back();
					that.subUnLoading = false;
				})
				// that.$.ajax({
				//   headers: {
				//     Authorization: getToken(constant.TOKEN) || ''
				//   },
				//   url: appName.NEWUNDR + '/unipnd/nucleusInit/doubleClick',//url路径
				//   type: 'POST', //GET
				//   async: false, //或false,是否异步
				//   data: JSON.stringify(para),
				//   timeout: time,
				//   contentType: "application/json;charset=UTF-8",
				//   success: function (res, textStatus, jqXHR) {
				//
				//
				//
				//   },
				//   error: function (xhr, textStatus, errorThrown) {
				//     if(textStatus=="timeout"){
				//       that.popMsg("网络超时，请重试",'error');
				//       that.back();
				//     }else{
				//       that.doLogin(xhr);
				//     }
				//     that.subUnLoading = false;
				//     that.$store.dispatch('loading/CHANGE_LOADING',false)
				//   }
				//
				// })
			},

			requestInit(para) {
				let that = this;
				let url = appName.NEWUNDR + '/unipnd/nucleusOperate/init';
				let res = uwLoadJs.ajaxRequest(para, url);
				that.subUnLoading = false;
				if (res.resultMsg) {
					this.$message({
						dangerouslyUseHTMLString: true,
						message: res.resultMsg,
						type: 'error'
					});
				}
				if (res.resultCode == constant.SUCCESS && res.data) {
					this.fillData(res);
					this.initData();
				} else {
					this.back();
					return false;
				}
			},

			check400(applnum) {
				let procflg = null;
				let params = {
					"applnum": applnum
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusInit/checkWDfor400';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res.resultCode == constant.SUCCESS) {
					procflg = res.data;
				} else {}
				return procflg;
			},
			checkbank(applnum) {
				let that = this;
				let params = {
					"applnum": applnum
				}
				// let url = appName.NEWUNDR + '/unipnd/check/checkBank';
				// let res = uwLoadJs.ajaxRequest(params,url);
				checkBank(params).then(res => {
					if (res && res.data) {
						console.log(res.data);
						that.$alert(res.data, '提示', {
							confirmButtonText: '确定',
							// callback: action => {
							//
							// }
						});
					}
				}).catch(err => {

				})
			},

			async initPage(params) {
				let that = this;
				await initPage(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						that.pageData = res.data;
						console.log("1.获取初始化数据：");
						console.log(that.pageData);

						let datas = [];
						let index = 0;
						that.pageData.forEach(ply => {
							index++;
							ply['appTabInfo'] = {};
							ply['appTabInfo'].tabname = '' + index;
							ply['appTabInfo'].appHistorys = [], //投保历史
								ply['appTabInfo'].appNotepads = [], //notepad
								ply['appTabInfo'].appPoss = [], //保全记录
								ply['appTabInfo'].appClaims = [], //理赔记录
								ply['appTabInfo'].appRenews = [], //续核记录
								ply['appTabInfo'].appHealths = [], //异常告知
								ply['appTabInfo'].appExams = [], //体检告知
								ply['appTabInfo'].appSupplements = [], //补充告知
								ply['appTabInfo'].appComplaints = [], //客户投诉记录
								ply['appTabInfo'].appTax = {}, //个人税收
								ply['appTabInfo'].appTrustClinet = {}, //委托人
								ply['appTabInfo'].appCusSize = 0, //客户查询记录
								ply['appTabInfo'].appRenewscount = 0, //续期和宝记录
								ply['appTabInfo'].complaints = 0, //客户投诉记录
								ply['appTabInfo'].appCount = 0, //投保记录
								ply['appTabInfo'].oldName = '',
								ply['appTabInfo'].name = '',
								ply['appTabInfo'].clntnum = ''
							let as_dyj = Number(ply.euaa.as_payment) - Number(ply.euaa.as_instprem);
							ply.euaa['as_dyj'] = Number(as_dyj).toFixed(2);
							ply.euaa.as_instprem = Number(ply.euaa.as_instprem).toFixed(2);
							ply.euaa['old_instprem'] = Number(ply.euaa.as_instprem);
							//计算保费
							let firstpremTotal = 0;
							let instpremTotal = 0;
							let euads = [];
							ply.trailer4.forEach(item => {
								if (item.approval != 'D' && item.approval != 'P') {
									//首期保费 firstprem
									firstpremTotal += Number(item.firstprem);
									//保费合计 instprem
									instpremTotal += Number(item.instprem);
								}
								//已缴保费
								item['oldapproval'] = item.approval;
								euads.push(item);
							});
							ply.trailer4 = euads;


							ply['firstpremTotal'] = firstpremTotal;
							ply['instpremTotal'] = instpremTotal;
							ply['appind'] = ""; //核准项
							ply['notOperation'] = false;


							//资料修正入口 待照会回复 再保处理 集汇件
							if (that.pageSource == uwconstant.pages.zlxz || that.pageSource ==
								uwconstant.pages.dzhhf) {
								ply['allInfoReadOnly'] = true;
							} else if (that.pageSource == uwconstant.pages.tbsx) { //特别事项入口
								that.isTBSX = true;
								if (ply.euaa.procflg == "1" || ply.euaa.procflg == "2" || ply.euaa
									.procflg == "3") { //建档、核保、照会状态
									ply['allInfoReadOnly'] = false;
								} else if (ply.euaa.procflg == "4") { //核决状态
									ply['allInfoReadOnly'] = true;
									//that.popMsg("保单"+ply.chdrnum+"出盘中，不允许修改",'error');
									let count = 0;
									let url = appName.NEWUNDR +
										'/unipnd/nucleusNote/checkAutopayinByApplnum';
									let res = uwLoadJs.ajaxRequest(params, url);
									if (res.resultCode == constant.SUCCESS && res.data != null) {
										count = res.data;
									}
									if (count > 0) {
										//that.popMsg("该单为autopayin 件,且正在出盘中, 不可进入受理模块",'error');
										that.popMsg("保单" + ply.chdrnum + "出盘中，不允许修改", 'error');
									}
								} else if (ply.euaa.procflg == "5" || ply.euaa.procflg ==
									"6") { //未入账、结案状态，不允许修改
									ply['allInfoReadOnly'] = true;
								} else {
									ply['allInfoReadOnly'] = false;
								}
							} else {
								ply['allInfoReadOnly'] = false;
							}

							if (ply.euaa.procflg == "5" || ply.euaa.procflg == "6") { //未入账、结案状态，不允许修改
								ply['allInfoReadOnly'] = true;
								ply['notOperation'] = true;
							}

							//核准权限
							let pnflag = false;
							if (ply.eufgpkyVO.pnflag != "Y") {
								pnflag = true;
							}
							ply['pnflag'] = pnflag; //
							ply['pnAddDis'] = false; //照会新增权限
							ply['pnDelDis'] = false; //照会删除权限
							ply['is_uwlevel'] = "N";
							ply['is_uwauth'] = "N";
							ply['is_uwflag'] = "N";
							ply['is_dangflag'] = "N";
							ply['is_indexflag'] = "N";
							ply['is_calc'] = "N";
							ply['oldProcflg'] = ply.euaa.procflg;
							ply['as_pnBackDate'] = ply.euaa.pnBackDate;
							ply.euaa['as_agntname01'] = ply.euaa.agntname01 + "/" + ply.euaa
							.agtydesc01;
							ply.euaa['tsalesdsc1'] = ply.euaa.tsalesunt + "/" + ply.euaa.tsalesdsc;
							ply['isSameToOther'] = true;
							ply['isSameToOtherPolicy'] = false;

							//初始化首次核保日期，首次核保人员
							if (ply.appldate01Appluser01List != null) {
								ply.euaa.firstApplDate = ply.appldate01Appluser01List[0].flag1;
								ply.euaa.firstApplUser = ply.appldate01Appluser01List[0].flag2;
							}

							//整单核保结论
							// that.changePolicyConclusions(ply);
							that.initPolicyConclusions(ply);

							datas.push(ply);
						});

						that.pageData = datas;
						//异步初始化头部信息
						let data = that.pageData[0];
						that.claimChdrnum = data.chdrnum; //查询理赔时使用保单号
						that.lda_date = data.unipndPageList[0].lda_date;
						that.userId = data.unipndPageList[0].userId;

						//vip信息
						that.showVip(data);
						that.curPageData = data;

						//是否展示powerview按钮
						if(that.pvProductFilter(data)) {
							that.pvTabFlag = true;
						}

						console.log("init finished.....")
						console.log("2.数据初始化完成" + that.pageData)

						//检查修改未保存
						that.saveCompareData();

						if (that.pageSource == uwconstant.pages.zlxz || that.pageSource == uwconstant.pages
							.dzhhf) {
							that.allInfoReadOnly = true;
						}

						//初始化照会背景颜色
						that.initEubaBg();

						that.$store.dispatch('loading/CHANGE_IS_OPEN', that.applnum);

					} else {
						that.back();
					}
				}).catch(err => {

				})
			},
			//获取页面初始化数据
			async initUwPage(params, time) {
				console.log("超时时间：" + time);
				let that = this;
				console.log(params);
				this.randomStr = getRandomStr();
				let para = {
					"data": JSON.stringify(params),
					"randomStr": this.randomStr,
				}
				// let url = appName.NEWUNDR + '/unipnd/nucleusInit/initPage';
				// let res = uwLoadJs.ajaxRequest(para,url);
				// that.subUnLoading = false;
				await that.initPage(para);
				console.log(that.subUnLoading)

				console.log("初始化投被保人信息");
				await that.initPersons();

				//处理投保人数据
				that.handlerInsData();
				that.$store.dispatch('loading/CHANGE_LOADING', false);
				that.subUnLoading = false;
				this.initUwPageTimeOut = setTimeout(function() {
					that.initData();
				}, 100)

			},
			handlerInsData() {
				let temp = [];
				this.pageData.forEach(item => {
					let clntnum = item.appTabInfo.clntnum;
					if (JSON.stringify(temp).indexOf(clntnum) < 0) {
						temp.push(clntnum);
						this.tabInsList.push(item);
					}
				})
			},
			initData() {
				let that = this;

				that.$store.dispatch('loading/CHANGE_LOADING', false);
				that.subUnLoading = false;

				console.log("初始化子模块标志");
				this.initDataTimeOut1 = setTimeout(function() {
					that.initFlag();
				}, 0)
				console.log("初始化页面控制，加费除外信息");
				this.initDataTimeOut2 = setTimeout(function() {
					that.pageData.forEach(ply => {
						let params = {
							"applnum": ply.curApplnum
						}
						console.log("电子投保标识号查询")
						findSernoByApplnum(params).then(res1 => {
							if (res1.resultCode == constant.SUCCESS && res1.data != null) {
								ply.euaa.serno = res1.data;
							}
						}).catch(err => {

						})

						ply.euaa['as_agentClass01'] = '';
						if (ply.euaa.agntnum01) {
							let params3 = {
								"agentId": ply.euaa.agntnum01
							};
							getLevel(params3).then(res3 => {
								if (res3.resultCode == constant.SUCCESS && res3.data != null) {
									ply.euaa['as_agentClass01'] = res3.data;
								}
							}).catch(err => {

							})
						}
						//页面控制
						that.useDisplay(ply);

						// if(that.pageSource!= uwconstant.pages.tsrk){
						ply['cancelApproval'] = false;

						// let procflg = that.check400(ply.curApplnum)
						checkWDfor400(params).then(res => {
							if (res.resultCode == constant.SUCCESS) {
								let procflg = res.data;
								if (procflg == "4") {
									console.log("wd检查为不可操作")
									ply['allInfoReadOnly'] = true;
									ply['cancelApproval'] = true;
								} else if (procflg == "5" || procflg == "6") {
									ply['allInfoReadOnly'] = true;
								}
							}
						}).catch(err => {

						})


						// //初始化加费、批注
						// if(ply.curApplnum!=""){
						//   that.initPostilPremium(ply.curApplnum);
						// }

						// that.getEufflvlvoListByUwlevel(ply);
						// that.sublvlindNotY(ply);
						// that.sublvlindInY(ply);
						// }
					})
				}, 0)

				console.log("初始化最高保额信息");
				this.initDataTimeOut3 = setTimeout(function() {
					that.initGDVO();
				}, 0)

				console.log("初始化延期，拒保原因信息")
				this.initDataTimeOut4 = setTimeout(function() {
					that.initReasons();
				}, 0)

				console.log("初始化投被保人健康告知，智能问答信息")
				that.initPersonHealths();
				console.log("初始化加费栏位险种权限")
				that.initFeeAddAuth();
				that.customer = that.curPageData.insLasInfo;
				//费率数据初始化
				that.flag03 = that.curPageData.insBaseInfo.flag03;
				console.log("初始化头部被保人信息")
				that.initHeadAppList(that.curPageData);
        if (that.curPageData.secondInsBaseInfo) {
          console.log("初始化头部第二被保人信息");
          that.initHeadSecondInsList(that.curPageData);
        }
				// that.initHeadInfo(that.curPageData);
				// that.subUnLoading = false;
				that.initHJdata();

				console.log("账号多客户检查")
				this.initDataTimeOut5 = setTimeout(function() {
					that.pageData.forEach(ply => {
						that.checkbank(ply.curApplnum);

						if (that.curPageData.curApplnum == ply.curApplnum) {
							that.curPageData = ply;
						}
						ply['oldEubas'] = JSON.parse(JSON.stringify(ply.eubas));
					})
				}, 1000)

        this.getAiTask()
			},
			//初始化加费栏位权限管控险种
			async initFeeAddAuth() {
				let para = {
					"eutblcode": "TMI,OPI,TOI,NOI,MZM,MZR,SMA,CLS,DSP,RAT,CS",
				}
				await queryListByCode(para).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						this.feeAddTMList = res.data.TMI;
						this.feeAddOPPCList = res.data.OPI;
						this.feeAddTOList = res.data.TOI;
						this.feeAddNOList = res.data.NOI;
						this.mzmList = res.data.MZM;
						this.mzrList = res.data.MZR;
						let showAmountList = res.data.SMA
						if(showAmountList || showAmountList.length>0){
							this.showAmount = showAmountList[0];
						}
						//add MerYang PowerView系统对接需求 20230201
						this.clsList = res.data.CLS;
						this.dspList = res.data.DSP;
						this.ratList = res.data.RAT;
						this.csList = res.data.CS;
						//add MerYang PowerView系统对接需求 20230201
					}
				}).catch(err => {
					console.log(err)
				})
			},
			async initHJdata() {
				let that = this;
				for (const ply of that.pageData) {
					await that.getEufflvlvoListByUwlevel(ply);
					that.sublvlindNotY(ply);
					that.sublvlindInY(ply);
				}
			},

			initPersonHealths() {
				let that = this;
				that.pageData.forEach(ply => {
          let clntnum3;
          if (ply.secondInsBaseInfo) {
            clntnum3 = ply.secondInsBaseInfo.clntnum;
          }
					let params = {
						"applnum": ply.curApplnum,
						"clntnum1": ply.insBaseInfo.clntnum,
						"clntnum2": ply.appBaseInfo.clntnum,
            "clntnum3": clntnum3
					}
					findPersonHealths(params).then(res => {
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							ply['insHealthInfo'] = res.data.insHealthInfo;
							ply['insAnswer'] = res.data.insAnswer;
							ply['appAnswer'] = res.data.appAnswer;
							ply['appHealthInfo'] = res.data.appHealthInfo;
              // 第二被保人需求 start
              ply['secondInsHealthInfo'] = res.data.secondInsHealthInfo;
              ply['secondInsAnswer'] = res.data.secondInsAnswer;
              // 第二被保人需求 end
							that.setData(ply);
						}
					}).catch(err => {

					})
				})

			},

			async initPersons() {
				let that = this;
				let index = 0;
				for (var ii = 0; ii < that.pageData.length; ii++) {
					let ply = that.pageData[ii];
					let params = {
						"applnum": ply.curApplnum
					}
					console.log("投被保人基本信息查询")
					await findPersonsInfo(params).then(res => {
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							console.log("序号：" + ii + "受理号：" + ply.curApplnum + "返回结果：" + JSON.stringify(res
								.data))
              // 第二被保人需求 start
              ply['secondInsBaseInfo'] = res.data.secondInsBaseInfo;
              ply['secondInsLasInfo'] = res.data.secondInsLasInfo;
              if (ply.secondInsLasInfo) {
                that.secondInsTabInfo.clntnum = ply.secondInsLasInfo.clntnum;
                that.secondInsTabInfo['oldName'] = ply.secondInsLasInfo.name;
                that.secondInsTabInfo['cardno'] = ply.secondInsLasInfo.cardno;
                that.secondInsTabInfo.name = "第二被保险人" + ply.secondInsLasInfo.name;
              }
              // 第二被保人需求 end
							ply['insBaseInfo'] = res.data.insBaseInfo;
							ply['insLasInfo'] = res.data.insLasInfo;
							ply['appBaseInfo'] = res.data.appBaseInfo;
							ply['appLasInfo'] = res.data.appLasInfo;
							ply['appTabInfo'].oldName = res.data.appLasInfo.name;
							ply['appTabInfo'].name = "投保人" + res.data.appLasInfo.name;
							ply['appTabInfo'].clntnum = res.data.appLasInfo.clntnum;
							if (index == 0) {
								index++;
								that.insTabInfo.clntnum = ply.insLasInfo.clntnum;
								that.insTabInfo['oldName'] = ply.insLasInfo.name;
								that.insTabInfo['cardno'] = ply.insLasInfo.cardno;
								that.insTabInfo.name = "被保险人" + ply.insLasInfo.name;
								that.insTabInfo.clntnum = ply.insLasInfo.clntnum;
								that.curPageData.appTabInfo = ply.appTabInfo;
								that.curInsPageData = ply
							}
						}
					});
				}
			},

			//初始化延期拒保取消原因 01-拒保，02-延期
			initReasons() {
				console.log("22===========================")
				let params = {
					"zresnpd": "01"
				}
				getListByParams(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.jbReason = res.data;
					}
				}).catch(err => {})
				let params1 = {
					"zresnpd": "02"
				}
				getListByParams(params1).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.yqReason = res.data;
					}
				}).catch(err => {})
				queryCarepky(params1).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.qxReason = res.data;
					}
				}).catch(err => {})
			},

			//最高保额
			initGDVO() {
				let that = this;
				console.log("initGDVO===========================")
				// let datas = [];
				// let url = appName.NEWUNDR + '/unipnd/nucleusInit/initIdwGDVOList';

				that.pageData.forEach(ply => {

					let idwGDVOList = [];
					let params = {
						"applnum": ply.curApplnum
					}
					initIdwGDVOList(params).then(res => {
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							idwGDVOList = res.data;
							let trs = [];
							ply.trailer4.forEach(item => {
								if (idwGDVOList != null) {
									let crtableTmp = item.crtable;
									if (crtableTmp == "UR02") {
										item.maxsumin = idwGDVOList[0].gd_hsuminur2;
									}

									if (crtableTmp == "URGT") {
										item.maxsumin = idwGDVOList[0].gd_hsuminur2t;
									}

									if (crtableTmp == "UNV1") {
										item.maxsumin = idwGDVOList[0].gd_hsuminunv1;
									}

									if (crtableTmp == "UVGT") {
										item.maxsumin = idwGDVOList[0].gd_hsuminuvgt;
									}

									if (crtableTmp == "SUV1") {
										item.maxsumin = idwGDVOList[0].gd_hsuminsuv;
									}

									if (crtableTmp == "SURT") {
										item.maxsumin = idwGDVOList[0].gd_hsuminsurt;
									}

									if (crtableTmp == "URRT") {
										item.maxsumin = idwGDVOList[0].gd_hsuminurrt;
									}

									if (crtableTmp == "UVRT") {
										item.maxsumin = idwGDVOList[0].gd_hsuminuvrt;
									}

									if (crtableTmp == "UR03" || crtableTmp == "URB2" ||
										crtableTmp == "IM0A" || crtableTmp == "IM0B" ||
										crtableTmp == "IM0C") {
										item.maxsumin = idwGDVOList[0].gd_hsuminur03;
									}

									if (crtableTmp == "SUV2") {
										item.maxsumin = idwGDVOList[0].gd_hsuminsuv2;
									}

									if (crtableTmp == "URT3" || crtableTmp == "URTP" ||
										crtableTmp == "UIMA" || crtableTmp == "UIMB" ||
										crtableTmp == "UIMC") {
										item.maxsumin = idwGDVOList[0].gd_hsuminurt3;
									}

									if (crtableTmp == "UNV2") {
										item.maxsumin = idwGDVOList[0].gd_hsuminunv2;
									}

									if (crtableTmp == "UVT2") {
										item.maxsumin = idwGDVOList[0].gd_hsuminuvt2;
									}

									if (crtableTmp == "SVT2") {
										item.maxsumin = idwGDVOList[0].gd_hsuminsvt2;
									}
									if (crtableTmp == "SUV3" || crtableTmp == "SUV4" ||
										crtableTmp == "SUV5" || crtableTmp == "SUV6" ||
										crtableTmp == "SUV7" || crtableTmp == "UR04" ||
										crtableTmp == "UR05") {
										item.maxsumin = idwGDVOList[0].gd_hsumin_m;
									}
									if (crtableTmp == "URT4" || crtableTmp == "URT5") {
										item.maxsumin = idwGDVOList[0].gd_hsumin_r;
									}
								}
								trs.push(item);
							});
							ply.trailer4 = trs;
							// datas.push(ply);
							that.setData(ply);
						}
					}).catch(err => {})
				})
				// this.pageData = datas;
			},

			useDisplay(pageData) {
				if (pageData.unipndPageList[0].is_option == "DSP") {
					this.wfDisplay(pageData);
				} else if (pageData.unipndPageList[0].is_uw1on == "Y" && pageData.unipndPageList[0].is_uw2on == "Y" &&
					pageData.unipndPageList[0].is_uw3on == "Y") {
					this.wfObjectEnable(pageData, false);
				}
				this.blockIdwTrailer();
			},

			//界面控制
			wfDisplay(pageData) {
				console.log("wfDisplay控制照会不可操作");
				if (pageData.eubas.length > 0) {
					let eubas = [];
					pageData.eubas.forEach(euba => {
						euba['pncodeBg'] = "RF";
						euba['pedescBg'] = "RF";
						euba['procflgBg'] = "RF";
						euba['clntnumSelectBg'] = "RB";

						eubas.push(euba);
					});

					pageData.eubas = eubas;
				}

				pageData['pnflag'] = true; //核准disabled
				//照会增加、删除按钮disabled
				pageData['pnAddDis'] = true;
				pageData['pnDelDis'] = true;
				//拒保/延期/取消

				this.setData(pageData);
			},

			//界面控制
			wfObjectEnable(pageData, ab_ind) {
				if (!ab_ind) {
					console.log("wfObjectEnable控制按钮不可操作");
					pageData['pnflag'] = true; //核准disabled
					//照会增加、删除按钮disabled
					pageData['pnAddDis'] = true;
					pageData['pnDelDis'] = true;
					//加费，除外disabled

					//照会内容只读设置
					if (pageData.eubas.length > 0) {
						let eubas = [];
						pageData.eubas.forEach(euba => {
							// euba['pncodeBg'] = "RF";
							// euba['pedescBg'] = "RF";
							euba['procflgBg'] = "RF";
							// euba['clntnumSelectBg'] = "RB";

							eubas.push(euba);
						});

						pageData.eubas = eubas;
					}


				} else { //核保决定选择未核决时
					console.log("wfObjectEnable控制按钮可操作");
					pageData['pnflag'] = false;
					//照会增加、删除按钮 enable
					pageData['pnAddDis'] = false;
					pageData['pnDelDis'] = false;
					//加费，除外 enable

					//照会内容只读设置
					if (pageData.eubas.length > 0) {
						let eubas = [];
						pageData.eubas.forEach(euba => {
							euba['pncodeBg'] = "F";
							euba['pedescBg'] = "F";
							euba['procflgBg'] = ""; //readOnly=false
							euba['clntnumSelectBg'] = "B";

							if (euba.resind == "N" && euba.rorceind == "Y") {
								if (eufgpky[0].forceind != "Y") {
									euba['procflgBg'] = "RF";
									console.log("照会处理码只读resind=N,rorceind=y,eufgpky.forceind!=Y" + eufgpky[0]
										.forceind);
								}
							} else if (euba.resind == "N" && euba.rorceind == "N") {
								euba['procflgBg'] = "RF";
								euba['pedescBg'] = "RF";
								console.log("照会处理码只读resind=N,rorceind=n");
							}

							eubas.push(euba);
						});

						pageData.eubas = eubas;
					}
				}

				this.setData(pageData);
			},

			//照会事项不可输入控制
			blockIdwTrailer() {
				let datas = []
				this.pageData.forEach(item => {
					if (item.eubas.length > 0) {
						let eubas = [];
						item.eubas.forEach(euba => {
							if (euba.pnfrom == "AUW" || euba.pnfrom == "MAGNUM" || euba.pnfrom != this
								.userId ||
								euba.pncode == "EE1" || euba.pncode == "C01" ||
								euba.pncode == "Q43" || euba.pncode == "Q44" ||
								euba.zresnpd == "04" || euba.rprntdate != "0") {
								euba['pncodeBg'] = "RF";
								euba['clntnumSelectBg'] = "RB";
							}

							eubas.push(euba);
						});

						item.eubas = eubas;
					}
					datas.push(item);
				})

				this.pageData = datas;
				console.log("照会事项不可输入控制完成：")
				console.log(this.pageData)
			},

      // 第二被保人需求 start
      initHeadSecondInsList(data) {
        let that = this;
        let fun1 = new Promise((resolve, reject) => {
          that.initHistory(2, data);
        });
        let fun2 = new Promise((resolve, reject) => {
          that.initNotepad(2, data);
        });
        let fun3 = new Promise((resolve, reject) => {
          that.initClaims(2, data);
        });
        let fun4 = new Promise((resolve, reject) => {
          that.initPoss(2, data);
        });
        let fun5 = new Promise((resolve, reject) => {
          that.initRenews(2, data);
        });
        let fun6 = new Promise((resolve, reject) => {
          that.initHealths(2, data);
        });
        let fun7 = new Promise((resolve, reject) => {
          that.initExams(2, data);
        });
        let fun8 = new Promise((resolve, reject) => {
          that.initSupplements(2, data);
        });
        let fun9 = new Promise((resolve, reject) => {
          that.initComplaints(2, data);
        });
        let fun10 = new Promise((resolve, reject) => {
          that.initSecondPres();
        });
        let fun11 = new Promise((resolve, reject) => {
          that.initCuss(4, data);
        });
        // 查询第二被保人头部信息
        Promise.all([fun1, fun2, fun3, fun4, fun5, fun6, fun7, fun8, fun9, fun10, fun11]).then((res) => {

        }).catch(err => {

        });

      },
      // 第二被保人需求 end

			initHeadAppList(data) {
				let that = this;
				let fun1 = new Promise((resolve, reject) => {
					that.initHistory(0, data);
				});
				let fun2 = new Promise((resolve, reject) => {
					that.initNotepad(0, data);
				});
				let fun3 = new Promise((resolve, reject) => {
					that.initClaims(0, data);
				});
				let fun4 = new Promise((resolve, reject) => {
					that.initPoss(0, data);
				});
				let fun5 = new Promise((resolve, reject) => {
					that.initRenews(0, data);
				});
				let fun6 = new Promise((resolve, reject) => {
					that.initHealths(0, data);
				});
				let fun7 = new Promise((resolve, reject) => {
					that.initExams(0, data);
				});
				let fun8 = new Promise((resolve, reject) => {
					that.initSupplements(0, data);
				});
				let fun9 = new Promise((resolve, reject) => {
					that.initComplaints(0, data);
				});
				let fun10 = new Promise((resolve, reject) => {
					that.initPres();
				});
				let fun11 = new Promise((resolve, reject) => {
					that.initCuss(2, data);
				});
				//查詢被保險人的頭部信息
				Promise.all([fun1, fun2, fun3, fun4, fun5, fun6, fun7, fun8, fun9, fun10, fun11]).then((res) => {

				}).catch(err => {

				});

			},
			initHeadInsList(data) {
				let fun01 = new Promise((resolve, reject) => {
					this.initHistory(1, data);
				});
				let fun02 = new Promise((resolve, reject) => {
					this.initNotepad(1, data);
				});
				let fun03 = new Promise((resolve, reject) => {
					this.initPoss(1, data);
				});
				let fun04 = new Promise((resolve, reject) => {
					this.initClaims(1, data);
				});
				let fun05 = new Promise((resolve, reject) => {
					this.initRenews(1, data);
				});
				let fun06 = new Promise((resolve, reject) => {
					this.initHealths(1, data);
				});
				let fun07 = new Promise((resolve, reject) => {
					this.initExams(1, data);
				});
				let fun08 = new Promise((resolve, reject) => {
					this.initSupplements(1, data);
				});
				let fun09 = new Promise((resolve, reject) => {
					this.initComplaints(1, data);
				});
				let fun010 = new Promise((resolve, reject) => {
					this.initCuss(1, data);
				});

				//查詢投保人的頭部信息
				Promise.all([fun01, fun02, fun03, fun04, fun05, fun06, fun07, fun08, fun09, fun010]).then((res) => {
					data['isCheck'] = true;
				}).catch(err => {

				});
			},
			//初始化头部列表信息
			initHeadInfo(data) {
				let that = this;
				//*********************被保人******************//
				//投保历史
				// setTimeout(function()  {
				// that.initWfOther(0, data);
				// that.initHistory(0, data);
				// }, 1000);
				//notepad
				// setTimeout(function()  {
				that.initNotepad(0, data);
				// }, 1000);
				//保全记录
				// setTimeout(function()  {
				that.initPoss(0, data);
				// }, 1000);
				//理赔记录
				// setTimeout(function()  {
				that.initClaims(0, data);
				// }, 1000);
				//续核记录
				// setTimeout(function()  {
				that.initRenews(0, data);
				// }, 1000);
				// //异常告知
				// setTimeout(function()  {
				that.initHealths(0, data);
				// }, 1000);
				// //体检告知
				// setTimeout(function()  {
				that.initExams(0, data);
				// }, 1000);
				// //补充告知
				// setTimeout(function()  {
				that.initSupplements(0, data);
				// }, 1000);

				//投诉记录
				// setTimeout(function()  {
				that.initComplaints(0, data);
				// }, 1000);

				//预核保
				// setTimeout(function()  {
				that.initPres();
				// }, 1000);

				//客户查询
				// setTimeout(function()  {
				that.initCuss(2, data);
				// }, 1000);
				//*********************投保人******************//
				//投保历史
				// setTimeout(function()  {
				// that.initWfOther(1,data);
				// that.initHistory(1,data);
				// }, 1000);
				// //notepad
				// setTimeout(function()  {
				that.initNotepad(1, data);
				// }, 1000);

				// //保全记录
				// setTimeout(function()  {
				that.initPoss(1, data);
				// }, 1000);

				// //理赔记录
				// setTimeout(function()  {
				that.initClaims(1, data);
				// }, 1000);

				// //续核记录
				// setTimeout(function()  {
				that.initRenews(1, data);
				// }, 1000);

				// //异常告知
				// setTimeout(function()  {
				that.initHealths(1, data);
				// }, 1000);

				// //体检告知
				// setTimeout(function()  {
				that.initExams(1, data);
				// }, 1000);

				// //补充告知
				// setTimeout(function()  {
				that.initSupplements(1, data);
				// }, 1000);
				//投诉记录
				// setTimeout(function()  {
				that.initComplaints(1, data);
				// }, 1000);

				//客户查询
				// setTimeout(function()  {
				that.initCuss(1, data);
				// }, 1000);


			},

			//初始化照会内容背景颜色
			//f3=#F3F3F3 F B7=#B7D8FD B blue=#AFEEEE G red=#F08080 R
			//pncodeBg pedescBg pedescRead procflgRead procflgBg
			initEubaBg() {
				let datas = [];
				this.pageData.forEach(ply => {
					//照会信息
					if (ply.eubas.length > 0) {
						let eubas = [];
						let index = 0;
						let allInfoReadOnly = ply.allInfoReadOnly;
						ply.eubas.forEach(euba => {
							euba.rprntdate = (euba.rprntdate == null || euba.rprntdate == '' || euba
								.rprntdate == undefined) ? 0 : euba.rprntdate;
							let pncodeBg = "B"; // 背景色 #B7D8FD
							let clntnumSelectBg = "B"; // 背景色 #B7D8FD
							let pedescBg = "";
							let pedescRead = false;
							let procflgRead = false;
							let procflgBg = "";

							if (euba.pntype == "1") { //照会事项
								if (euba.zresnpd == "06") {
									pedescRead = true; // 只读
									pedescBg = "F"; //背景色为 #F3F3F3
								} else {
									pedescBg = "B"; //#B7D8FD
								}
							} else if (euba.pntype == "2" || euba.pntype == "3") { //问卷 、补充告知书
								pedescBg = "B"; //#B7D8FD
								pncodeBg = "B"; //#B7D8FD
								clntnumSelectBg = "B"; //#B7D8FD
							}

							if (euba.resind == "N" && euba.forceind == "Y") { //处理码背景色
								procflgBg = "G"; //蓝色 #AFEEEE
								if (ply.eufgpkyVO.forceind != "Y") {
									procflgRead = true;
								}
							} else if (euba.resind == "N" && euba.forceind == "N") {
								procflgBg = "R"; //红色 #F08080
								procflgRead = true;
								pedescBg = "F";
								pedescRead = true;
							}

							if (euba.pntype == "1") {
								//批注类照会禁止修改照会说明
								if (euba.zresnpd == "04" && euba.pncode.substring(0, 1) == "E") {
									pedescBg = "F";
									pedescRead = true;
								}
							}

							if (allInfoReadOnly) {
								euba['pncodeBg'] = "RB"; // 背景色 #B7D8FD
							} else {
								euba['pncodeBg'] = pncodeBg; // 背景色 #B7D8FD
							}

							euba['clntnumSelectBg'] = clntnumSelectBg;
							euba['pncodeOld'] = euba.pncode;
							euba['oldProcflg'] = euba.procflg;
							euba['isOld'] = true;
							euba['num'] = index;
							index++;


							if (pedescRead) {
								if (pedescBg == "R") {
									euba['pedescBg'] = "RR";
								} else if (pedescBg == "G") {
									euba['pedescBg'] = "RG";
								} else if (pedescBg == "F") {
									euba['pedescBg'] = "RF";
								} else {
									euba['pedescBg'] = "RB";
								}
							} else {
								if (allInfoReadOnly) {
									euba['pedescBg'] = "RB"; // 背景色 #B7D8FD
								} else {
									euba['pedescBg'] = pedescBg;
								}

							}


							if (procflgRead) {
								if (procflgBg == "R") {
									euba['procflgBg'] = "RR";
								} else if (procflgBg == "G") {
									euba['procflgBg'] = "RG";
								} else if (procflgBg == "F") {
									euba['procflgBg'] = "RF";
								} else {
									euba['procflgBg'] = "RB";
								}
							} else {
								if (allInfoReadOnly) {
									euba['procflgBg'] = "RB"; // 背景色 #B7D8FD
								} else {
									euba['procflgBg'] = procflgBg;
								}
							}

							console.log("初始化照会颜色pncode=" + euba.pncode + ",pedescBg=" + pedescBg +
								",procflgBg=" + procflgBg);
							eubas.push(euba);
						});

						ply.eubas = eubas;
					}
					datas.push(ply);
				});
				this.pageData = datas;
				console.log("初始化照会内容背景颜色")
				console.log(this.pageData)

			},

			//vip等级信息显示
			showVip(data) {
				let vipLevel = data.vipLevelList[0].flag1;
				if (data.headClntnumList.length == 1) {
					if (vipLevel == null) {
						this.vip = "非VIP客户";
					} else if (vipLevel == "VIP01") {
						this.vip = "VIP客户等级：银卡";
					} else if (vipLevel == "VIP02") {
						this.vip = "VIP客户等级：金卡";
					} else {
						this.vip = "非VIP客户";
					}
				} else if (data.headClntnumList.length > 1) {

					if (vipLevel.indexOf("VIP02") != -1) {
						this.vip = "VIP客户等级：金卡";
					} else if (vipLevel.indexOf("VIP01") != -1) {
						this.vip = "VIP客户等级：银卡";
					} else {
						this.vip = "非VIP客户";
					}
				}
			},


			//初始化险种配置的除外照会信息
			initCrtablePn() {
				let _that = this;
				let datas = [];
				let url = appName.NEWUNDR + '/unipnd/nucleusInit/findInfoByCrtable';
				_that.pageData.forEach(ply => {
					ply.trailer4.forEach(item => {
						let params = {
							"crtable": item.crtable
						}
						let pncode = "";
						let res = uwLoadJs.ajaxRequest(params, url);
						if (res == null) {
							return false;
						}
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							pncode = res.data.pncode;
						}

						if (pncode != "") {
							let flag = false;
							//遍历照会 是否已存在相同照会
							ply.eubas.forEach(euba => {
								if (euba.pncode = pncode && euba.rprntdate == 0) {
									flag = true;
								}
							})

							//不存在，新增照会
							if (!flag) {
								let params2 = {
									"pncode": pncode
								}
								let lds_pn = null;
								let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
								if (res == null) {
									return false;
								}
								if (res.resultCode == constant.SUCCESS && res.data != null) {
									lds_pn = res.data;
								}

								let params3 = {
									"ls_date": ply.unipndPageList[0].lda_date,
									"ll_remindday": lds_pn.remindday + ""
								}
								let lda_reminddate = "0";
								let res1 = uwLoadJs.deteRoll(params3);
								if (res1 == null) {
									return false;
								}
								if (res1.resultCode == constant.SUCCESS && res1.data != null) {
									lda_reminddate = res1.data;
								}

								let memodesc = ply.euaa.tsalesunt + uwJs.showTime().substring(2);
								if (lds_pn.zresnpd == "10") {
									memodesc = "$$$$$" + uwJs.showTime().substring(2);
								}

								let euba = {
									applnum: ply.curApplnum,
									zresnpd: lds_pn.zresnpd,
									pntype: "1",
									chdrnum: ply.chdrnum,
									memodesc: memodesc,
									pndate: ply.unipndPageList[0].lda_date,
									dateend: "0",
									forceind: lds_pn.forceind,
									resind: lds_pn.resind,
									prtopt: lds_pn.prtopt,
									zprtcert: lds_pn.authnow,
									reminddate: Number(lda_reminddate),
									remindflg: "N",
									crtuser: "",
									dtecrt: "0",
									crttime: "0",
									nofday: lds_pn.nofday,
									source: lds_pn.source,
									jobName: uwconstant.jobName,
									userProfile: "",
									datime: this.initTime(),
									as_hand: ply.eufgpkyVO.forceind,
									clntnum: item.clntnum,
									pncode: pncode,
									procflg: "",
									pedesc: lds_pn.pedesc,
									as_pndate: ply.unipndPageList[0].lda_date,
									rprntdate: "0",
									userid: "",
									pnfrom: ply.unipndPageList[0].userId,
									as_dateend: "0",
									pncodeBg: "B",
									pedescBg: "B",
									clntnumSelectBg: "B",
									num: ply.eubas.length
								}

								ply.eubas.push(euba);
							}

						}

					})

					datas.push(ply);
				})

				_that.pageData = datas;
			},

			/***************************页面初始化 END**********************************************/



			/***************************头部列表初始化 BEGIN**********************************************/

			//险种对应的说明
			initDesc() {
				let that = this;
				let notedescList = [];
				let url = appName.NEWUNDR + '/unipnd/nucleusInit/queryCnnmpf';
				let res = uwLoadJs.ajaxRequest({}, url);
				if (res == null) {
					return false;
				}
				notedescList = res.data;

				this.notedescList = notedescList;
			},

			getCrtableDesc(crtable, srcebus) {
				let itemitem = crtable + srcebus;
				let tableDesc = "";
				let shortDesc = "";
				let flag = false;
				for (var j = 0; j < this.notedescList.length; j++) {
					let notedesc = this.notedescList[j];
					if (notedesc.crtable == crtable) {
						if (crtable == notedesc.itemitem) {
							shortDesc = notedesc.notedesc;
						}
						if (itemitem == notedesc.itemitem) {
							tableDesc = notedesc.notedesc;
							flag = true;
							break;
						}
					}
				}
				if (flag == false) {
					tableDesc = shortDesc;
				}
				return tableDesc;
			},

			/**
			 * 投保记录
			 * @param type type=0 被保人 type=1投保人
			 * @param data
			 */
			/**
			 * 投保记录
			 * @param type type=0 被保人 type=1投保人 type=2 第二被保人
			 * @param data
			 */
			initHistory(type, data) {
				console.log("投保记录")
				let _that = this;
				if (this.notedescList && this.notedescList.length == 0) {
					this.initDesc();
				}

				let idno = "";
				let clntnum = "";
				if (type == 0) {
					idno = data.insBaseInfo.cardno;
					clntnum = data.insBaseInfo.clntnum;
					this.insTabInfo['insCount'] = 0;
				} else if (type == 2){
          idno = data.secondInsBaseInfo.cardno;
          clntnum = data.secondInsBaseInfo.clntnum;
          this.secondInsTabInfo['insCount'] = 0;
        } else {
					idno = data.appBaseInfo.cardno;
					clntnum = data.appBaseInfo.clntnum;
					data.appTabInfo['appCount'] = 0;
				}
				let params1 = {
					"clntnum": clntnum
				}
				// let url1 = appName.NEWUNDR + '/unipnd/nucleusInit/initHistory';
				// let res1 = uwLoadJs.ajaxRequest(params1,url1);
				initHistory(params1).then(res1 => {
					if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						let dw_other1 = res1.data;
						let newList = [];
						let dw_other = [];
						let count = 0;
						let oldChdrnum = "";
						//剔除当前单
						let chdrnums = "";
						for (let i = 0; i < this.pageData.length; i++) {
							let chdrnum = this.pageData[i].chdrnum;
							chdrnums += chdrnum + ",";
						}
						for (let j = 0; j < dw_other1.length; j++) {
							let item = dw_other1[j];
							if (chdrnums.indexOf(item.chdrnum) < 0) {
								dw_other.push(item);
							}
						}
						for (let i = 0; i < dw_other.length; i++) {
							let item = dw_other[i];
							let desc = "";
							desc = this.getCrtableDesc(item.crtable, "");
							if (desc == "") {
								desc = item.crtable;
							}
							item['desc'] = desc;
							if (i == 0) {
								oldChdrnum = item.chdrnum;
								item['show'] = true;
								count++;
							} else {
								if (oldChdrnum != item.chdrnum) {
									oldChdrnum = item.chdrnum;
									count++;
									item['show'] = true;
								} else {
									item['show'] = false;
								}
							}
							newList.push(item);
						}
						if (type == 0) {
							this.insTabInfo['insHistorys'] = newList;
							this.insTabInfo['insCount'] = count;
						} else if(type == 2){
              this.secondInsTabInfo['insHistorys'] = newList;
              this.secondInsTabInfo['insCount'] = count;
            } else {
							data.appTabInfo['appHistorys'] = newList;
							data.appTabInfo['appCount'] = count;
						}
					}
					if (type == 0) {
						this.isInsHistorys = true;
					} else if (type == 2) {
            this.isSecondInsHistorys = true;
          }else {
						this.isAppHistorys = true;
					}
				}).catch(error => {
					if (type == 0) {
						this.isInsHistorys = true;
					}else if (type == 2) {
            this.isSecondInsHistorys = true;
          } else {
						this.isAppHistorys = true;
					}
				});

			},
			initWfOther(type, data) {
				let _that = this;
				if (this.notedescList && this.notedescList.length == 0) {
					this.initDesc();
				}

				let idno = "";
				let clntnum = "";
				if (type == 0) {
					idno = data.insBaseInfo.cardno;
					clntnum = data.insBaseInfo.clntnum;
					this.insTabInfo['insCount'] = 0;
				} else {
					idno = data.appBaseInfo.cardno;
					clntnum = data.appBaseInfo.clntnum;
					data.appTabInfo['appCount'] = 0;
				}



				let params = {
					"life": data.unipndPageList[0].is_lifeauths,
					"is_indexflag": "N",
					"is_currlife": "",
					"as_idno": idno,
					"applnum": data.curApplnum,
					"euaa": JSON.stringify(data.euaa),
				}
				initWfOther(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						let dw_other1 = res.data.dw_other;
						let newList = [];
						let dw_other = [];
						let count = 0;
						let oldChdrnum = "";
						//剔除当前单
						for (let i = 0; i < this.pageData.length; i++) {
							let chdrnum = this.pageData[i].chdrnum;
							for (let j = 0; j < dw_other1.length; j++) {
								let item = dw_other1[j];
								if (chdrnum != item.chdrnum) {
									dw_other.push(item);
								}
							}
						}
						for (let i = 0; i < dw_other.length; i++) {
							let item = dw_other[i];
							let desc = "";
							desc = this.getCrtableDesc(item.crtable, "");
							if (desc == "") {
								desc = item.crtable;
							}
							item['desc'] = desc;
							if (i == 0) {
								oldChdrnum = item.chdrnum;
								item['show'] = true;
								count++;
							} else {
								if (oldChdrnum != item.chdrnum) {
									oldChdrnum = item.chdrnum;
									count++;
									item['show'] = true;
								} else {
									item['show'] = false;
								}
							}
							newList.push(item);
						}
						if (type == 0) {
							this.insTabInfo['insHistorys'] = newList;
							this.insTabInfo['insCount'] = count;
						} else {
							data.appTabInfo['appHistorys'] = newList;
							data.appTabInfo['appCount'] = count;
						}
					}
					if (type == 0) {
						this.isInsHistorys = true;
					} else {
						this.isAppHistorys = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsHistorys = true;
					} else {
						this.isAppHistorys = true;
					}
				})
			},
			/**
			 * 初始化notepad
			 * @param type
			 * @param data
			 */
			initNotepad(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        } else {
					idno = data.appBaseInfo.clntnum;
				}

				let params = {
					"pageSize": 1000,
					"pageNumber": 1,
					"clntnum": idno
				}

				getListNotepadIcd(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data.list.length) {

						if (type == 0) {
							this.insTabInfo['insNotepads'] = res.data.list;
							this.insNoteSize = res.data.total;
						} else if (type == 2) {
              this.secondInsTabInfo['insNotepads'] = res.data.list;
              this.secondInsNoteSize = res.data.total;
            }else {
							data.appTabInfo['appNotepads'] = res.data.list;
							data.appTabInfo['appNoteSize'] = res.data.total;
						}

					}
					if (type == 0) {
						this.isInsNotepads = true;
					} else if (type == 2) {
            this.isSecondInsNotepads = true;
          } else {
						this.isAppNotepads = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsNotepads = true;
					} else if (type == 2) {
            this.isSecondInsNotepads = true;
          } else {
						this.isAppNotepads = true;
					}
				})

			},
			//保全记录
			initPoss(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if(type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        }else {
					idno = data.appBaseInfo.clntnum;
				}
				let params = {
					"clntnum": idno
				}
				findPos(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						let psList = res.data;
						if (type == 0) {
							this.insTabInfo['insPoss'] = psList;
						} else if(type == 2) {
              this.secondInsTabInfo['insPoss'] = psList;
            }else {
							data.appTabInfo['appPoss'] = psList;
						}
					}
					if (type == 0) {
						this.isInsPoss = true;
					} else if (type == 2) {
            this.isSecondInsPoss = true;
          } else {
						this.isAppPoss = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsPoss = true;
					} else if (type == 2) {
            this.isSecondInsPoss = true;
          } else {
						this.isAppPoss = true;
					}
				})
			},
			//理赔记录
			initClaims(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        }else {
					idno = data.appBaseInfo.clntnum;
				}
				let params = {
					"pageSize": 1000,
					"pageNumber": 1,
					"customerNo": idno,
          "applnum": data.euaa.applnum,
          "chdrnum": data.euaa.chdrnum
				}
				claimCount(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null && res.data.list) {
						let claimList = res.data.list;
						if (type == 0) {
							this.insTabInfo['insClaims'] = claimList;
						} else if (type == 2){
              this.secondInsTabInfo['insClaims'] = claimList;
            }else {
							data.appTabInfo['appClaims'] = claimList;
						}
					}
					if (type == 0) {
						this.isInsClaims = true;
					} else if (type == 2) {
            this.isSecondInsClaims = true;
          } else {
						this.isAppClaims = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsClaims = true;
					} else if (type == 2) {
            this.isSecondInsClaims = true;
          } else {
						this.isAppClaims = true;
					}
				})
			},
			//续核记录
			initRenews(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
					this.insTabInfo['insRenewscount'] = 0;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
          this.secondInsTabInfo['insRenewscount'] = 0;
        } else {
					idno = data.appBaseInfo.clntnum;
					data.appTabInfo['appRenewscount'] = 0;
				}
				let params = {
					"pageSize": 10000,
					"pageNumber": 1,
					"clntnum": idno //"50168127"
				}
				findContiNucleNoteHistory(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						let historys = res.data.list;
						let count = 0;
						for (let i = 0; i < historys.length; i++) {
							let item = historys[i];
							if (item.clmnumShow != "") {
								count++;
							}
						}
						if (type == 0) {
							this.insTabInfo['insRenews'] = historys;
							this.insTabInfo['insRenewscount'] = count;
						} else if (type == 2) {
              this.secondInsTabInfo['insRenews'] = historys;
              this.secondInsTabInfo['insRenewscount'] = count;
            } else {
							data.appTabInfo['appRenews'] = historys;
							data.appTabInfo['appRenewscount'] = count;
						}
					}
					if (type == 0) {
						this.isInsRenews = true;
					} else if (type == 2) {
            this.isSecondInsRenews = true;
          } else {
						this.isAppRenews = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsRenews = true;
					} else if (type == 2) {
            this.isSecondInsRenews = true;
          } else {
						this.isAppRenews = true;
					}
				})
			},
			//异常告知
			initHealths(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        }else {
					idno = data.appBaseInfo.clntnum;
				}
				let params = {
					"clntnum": idno
				}
				findHealthReport(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						let list = res.data;
						if (type == 0) {
							this.insTabInfo['insHealths'] = list;
						} else if (type == 2) {
              this.secondInsTabInfo['insHealths'] = list;
            }else {
							data.appTabInfo['appHealths'] = list;
						}
					}
					if (type == 0) {
						this.isInsHealths = true;
					} else if (type == 2) {
            this.isSecondInsHealths = true;
          } else {
						this.isAppHealths = true;
					}
				}).catch(err => {
					if (type == 0) {
						this.isInsHealths = true;
					} else if (type == 2) {
            this.isSecondInsHealths = true;
          } else {
						this.isAppHealths = true;
					}
				})
			},
			//体检告知
			initExams(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        }else {
					idno = data.appBaseInfo.clntnum;
				}

				let policyNos = "";
				let params1 = {
					"clntnum": idno
				}
				// let url = appName.NEWUNDR + '/unipnd/euab/getChdrnumByClntnum';
				// let res = uwLoadJs.ajaxRequest(params1,url);
				getChdrnumByClntnum(params1).then(res => {
					if (res.data != null) {
						if (res.data.length > 0) {
							res.data.forEach(item => {
								policyNos = policyNos + item + ",";
							})
						}
						if (policyNos.indexOf(",") != -1) {
							policyNos = policyNos.substring(0, policyNos.length - 1);
						}
					}
					// policyNos="02357488";
					if (policyNos != "") {
						let doctype = "体检报告单,`体检报告单,门诊病历,其他病历资料,`门诊病历,`其他病历资料,病历资料,承保后调查报告";
						let docType = doctype
						let params1 = {
							"begintime": "",
							"birthday": "",
							"branchCode": "",
							"busiNO": "",
							"busiType": "NB",
							"comCode": "",
							"docType": docType,
							"doflag": "caseimage",
							"groupNO": "",
							"imgsort": "",
							"imgsortorder1": "",
							"imgsortorder2": "",
							"imgsortorder3": "",
							"insured": "",
							"isNoCaseno": "",
							"isPrint": "",
							"policyer": "",
							"policyNO": policyNos ? policyNos : "",
							"policyno16": "",
							"productType": "",
							"serno": "",
							"stockID": "",
							"sproductType": "",
							"spurview": "query",
							"stype": "general"
						}
						ImageQuerySearch(params1, this.userId, 1000, 1).then(res => {
							if (res.resultCode == constant.SUCCESS && res.resBody) {
								if (res.strDoFlag == "image" || res.strDoFlag == "caseimage") {
									let list = res.resBody.imageList;
									if (type == 0) {
										this.insTabInfo['insExams'] = list;
									} else if (type == 2) {
                    this.secondInsTabInfo['insExams'] = list;
                  }else {
										data.appTabInfo['appExams'] = list;
									}
								}
							}
						}).catch(err => {

						})
					}
				}).catch(error => {
					if (type == 0) {
						this.isInsExams = true;
					} else if (type == 2) {
            this.isSecondInsExams = true;
          } else {
						this.isAppExams = true;
					}
				});

				if (type == 0) {
					this.isInsExams = true;
				} else if (type == 2) {
          this.isSecondInsExams = true;
        } else {
					this.isAppExams = true;
				}




			},
			//补充告知
			initSupplements(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
        }else {
					idno = data.appBaseInfo.clntnum;
				}
				if (type == 0) {
					this.insTabInfo['insSupplements'] = [];
				} else if (type == 2) {
          this.secondInsTabInfo['insSupplements'] = [];
        }else {
					data.appTabInfo['appSupplements'] = [];
				}
				let policyNos = "";
				let params1 = {
					"clntnum": idno
				}
				// let url = appName.NEWUNDR + '/unipnd/euab/getChdrnumByClntnum';
				// let res = uwLoadJs.ajaxRequest(params1,url);
				getChdrnumByClntnum(params1).then(res => {
					if (res.data != null) {
						if (res.data.length > 0) {
							res.data.forEach(item => {
								policyNos = policyNos + item + ",";
							})
						}
						if (policyNos.indexOf(",") != -1) {
							policyNos = policyNos.substring(0, policyNos.length - 1);
						}
					}
					// policyNos = "02291226";
					if (policyNos != "") {
						let doctype = "新契约告知书,补充告知声明书,`新契约告知书,`补充告知声明书";
						let docType = doctype
						let params1 = {
							"begintime": "",
							"birthday": "",
							"branchCode": "",
							"busiNO": "",
							"busiType": "NB",
							"comCode": "",
							"docType": docType,
							"doflag": "caseimage",
							"groupNO": "",
							"imgsort": "",
							"imgsortorder1": "",
							"imgsortorder2": "",
							"imgsortorder3": "",
							"insured": "",
							"isNoCaseno": "",
							"isPrint": "",
							"policyer": "",
							"policyNO": policyNos ? policyNos : "",
							"policyno16": "",
							"productType": "",
							"serno": "",
							"stockID": "",
							"sproductType": "",
							"spurview": "query",
							"stype": "general"
						}
						ImageQuerySearch(params1, this.userId, 1000, 1).then(res => {
							if (res.resultCode == constant.SUCCESS && res.resBody) {
								if (res.strDoFlag == "image" || res.strDoFlag == "caseimage") {
									let list = res.resBody.imageList;
									if (type == 0) {
										this.insTabInfo['insSupplements'] = list;
									} else if (type == 2) {
                    this.secondInsTabInfo['insSupplements'] = list;
                  }else {
										data.appTabInfo['appSupplements'] = list;
									}
								}
							}
							if (type == 0) {
								this.isInsSupplements = true;
							} else if (type == 2) {
                this.isSecondInsSupplements = true;
              } else {
								this.isAppSupplements = true;
							}

						}).catch(err => {

						})
					}
				}).catch(error => {
					if (type == 0) {
						this.isInsSupplements = true;
					} else if (type == 2) {
            this.isSecondInsSupplements = true;
          } else {
						this.isAppSupplements = true;
					}
				});


				if (type == 0) {
					this.isInsSupplements = true;
				} else if (type == 2) {
          this.isSecondInsSupplements = true;
        } else {
					this.isAppSupplements = true;
				}


			},
			//客户投诉记录
			initComplaints(type, data) {
				let idno = "";
				if (type == 0) {
					idno = data.insBaseInfo.clntnum;
					this.insTabInfo['complaints'] = 0;
				} else if (type == 2) {
          idno = data.secondInsBaseInfo.clntnum;
          this.secondInsTabInfo['complaints'] = 0;
        }else {
					idno = data.appBaseInfo.clntnum;
					data.appTabInfo['complaints'] = 0;
				}
				if (idno) {
					// idno="60703302";
					let params = {
						"customerNo": idno
					}
					findCustomerComplaints(params).then(res => {
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							let total = res.data.total;
							if (type == 0) {
								this.insTabInfo['complaints'] = total;
							} else if (type == 2) {
                this.secondInsTabInfo['complaints'] = total;
              } else {
								data.appTabInfo['complaints'] = total;
							}
						}
						if (type == 0) {
							this.isInsComplaints = true;
						} else if (type == 2) {
              this.isSecondInsComplaints = true;
            } else {
							this.isAppComplaints = true;
						}
					}).catch(err => {
						if (type == 0) {
							this.isInsComplaints = true;
						} else if (type == 2) {
              this.isSecondInsComplaints = true;
            } else {
							this.isAppComplaints = true;
						}
					})
				} else {
					if (type == 0) {
						this.isInsComplaints = true;
					} else if (type == 2) {
            this.isSecondInsComplaints = true;
          } else {
						this.isAppComplaints = true;
					}
				}


			},

			//客户查询
			initCuss(type, data) {
				let params = {
					"roleflag": type + "",
					"applnum": data.curApplnum
				}
				findPolicyByApplnum(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						if (type == 2) {
							this.insCusSize = res.data.length;
						} else if (type == 4) {
              this.secondInsCusSize = res.data.length;
            }else {
							data.appTabInfo['appCusSize'] = res.data.length;
						}
					}
					if (type == 2) {
						this.isInsCus = true;
					} else if (type == 4) {
            this.isSecondInsCus = true;
          } else {
						this.isAppCus = true;
					}
				}).catch(error => {
					if (type == 2) {
						this.isInsCus = true;
					} else if (type == 4) {
            this.isSecondInsCus = true;
          } else {
						this.isAppCus = true;
					}
				});
				// let url = appName.NEWUNDR + '/unipnd/customer/findPolicyByApplnum';

			},

      // 第二被保人需求 start
      initSecondPres(){
        let idno = this.secondInsTabInfo.cardno;
        let params = {
          "idNum": idno
        }
        preQueryListByIdNum(params).then(res => {
          this.secondInsTabInfo['insPres'] = [];
          for (let i = 0; i < res.data.length; i++) {
            let item = res.data[i];
            if (!item.caseNo) {
              item.caseNo = "";
            }
            this.secondInsTabInfo['insPres'].push(item);
          }
          this.isSecondInsPres = true;
        }).catch(error => {
          this.isSecondInsPres = true;
        });
      },
      // 第二被保人需求 end

			initPres() {
				let idno = this.insTabInfo.cardno;
				// idno = "123";
				let params = {
					"idNum": idno
				}
				// let url = appName.TASK + '/advance/task/preQueryListByIdNum';
				// let res = uwLoadJs.ajaxRequest(params,url);
				preQueryListByIdNum(params).then(res => {
					this.insTabInfo['insPres'] = [];
					for (let i = 0; i < res.data.length; i++) {
						let item = res.data[i];
						if (!item.caseNo) {
							item.caseNo = "";
						}
						this.insTabInfo['insPres'].push(item);
					}
					this.isInsPres = true;
				}).catch(error => {
					this.isInsPres = true;
				});


			},

			getPres(e) {
				this.insTabInfo['insPres'] = e;
			},
      // 第二被保人头部预核保
      getSecondPres(e) {
        this.secondInsTabInfo['insPres'] = e;
      },
			/***************************头部列表初始化 END**********************************************/


			/***************************核保意见 BEGIN**********************************************/
			//新增核保意见
			addEucm(data) {
				data.trailer13.forEach(item => {
					item['checked'] = false;
				})
				this.eucm = {
					applnum: data.curApplnum,
					descitem: "",
					bmntdesc: "",
					effdate: "0",
					userProfile: this.userId,
					jobName: uwconstant.jobName,
					datime: this.initTime(),
					flag01: "",
					flag02: "",
					flag03: "",
					flag04: "",
					flag05: "",
					checked: true,
					mod: "new"
				}
				data.trailer13.push(this.eucm);
				this.getIndex = data.trailer13.length - 1;
				console.log("新增核保意见：")
				console.log(this.pageData);
			},
			//更新核保意见
			updateEucm(data) {
				if (this.eucm['checked'] && this.bmntdesc != "") {
					//判断当前选中第几行，并且不是新增
					let flagNum = 0;
					for (let i = 0; i < data.trailer13.length; i++) {
						if (this.eucm['checked'] == data.trailer13[i]['checked'] && data.trailer13[i].mod != 'new') {
							flagNum = i + 1;
							break;
						}
					}
					let isTodayData = false;

					if (this.userId != this.eucm.userProfile) {
						this.popMsg("注意：当前用户" + this.userId + "不可以修改历史记录", 'error');
						return false;
					} else {
						if (Number(this.eucm.effdate) == Number(this.lda_date) || Number(this.eucm.effdate) == 0) {
							isTodayData = true;
						}
					}

					if (Number(this.eucm.effdate) >= Number(this.lda_date) && (!this.eucm['checked']) || !isTodayData || (
							flagNum != 0 && flagNum != data.trailer13.length)) {
						this.popMsg("注意：当前用户" + this.userId + "不可以修改历史记录", 'error');
						return false;
					}


					this.eucm.bmntdesc = this.bmntdesc;
					this.eucm.effdate = this.lda_date;
				} else {
					this.popMsg("请选择一行数据", 'error');
				}

			},
			//删除核保意见
			delEucm(data) {
				if (this.eucm['checked']) {
					//判断当前选中第几行，并且不是新增
					let flagNum = 0;
					for (let i = 0; i < data.trailer13.length; i++) {
						if (this.eucm['checked'] == data.trailer13[i]['checked'] && data.trailer13[i].mod != 'new') {
							flagNum = i + 1;
							break;
						}
					}

					if (this.userId != this.eucm.userProfile) {
						this.popMsg("注意：当前用户" + this.userId + "没有权限删除历史记录", 'error');
						return false;
					} else {
						if (Number(this.eucm.effdate) != Number(this.lda_date) && Number(this.eucm.effdate) != 0 || (
								flagNum != 0 && flagNum != data.trailer13.length)) {
							this.popMsg("注意：当前用户" + this.userId + "不可以删除历史记录", 'error');
							return false;
						}
					}

					//移除选定对象
					data.trailer13 = data.trailer13.filter(item => !item['checked']);
					this.eucm = {};
				} else {
					this.popMsg("请选择一行数据", 'error');
				}
			},
			//初始化当前时间
			initTime() {
				let ldt_datime = null;
				let ls_date = this.lda_date; //当前系统时间
				let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) + "-" + ls_date.substring(6, 8);
				let lt_time = uwJs.showTime();
				let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) + ":" + lt_time.substring(12, 14);
				let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				ldt_datime = lda_date + " " + ll_time;
				return ldt_datime;
			},

			handleSelectionChange(val) {
				console.log(val)
				this.multipleSelection = val;
			},
			//检查核保意见
			wfCheckUw(data) {
				let index = 0;
				data.trailer13.forEach(eucm => {
					let ll_date = Number(eucm.effdate);
					let ls_date = Number(data.unipndPageList[0].lda_date);
					let userProfile = eucm.userProfile;

					if (ll_date == ls_date && userProfile == this.userId) {
						index++;
					}
					if (userProfile == "") {
						index++;
					}
				})

				if (index > 0) {
					return 1;
				} else {
					return 0;
				}

			},
			//点击核保意见，展示意见详细信息
			showDesc(row, column, event) {
				console.log(row);
				console.log(column);
				this.getIndex = column.index;
				row.trailer13.forEach(item => {
					item['checked'] = false;
				})
				this.bmntdesc = column.bmntdesc;
				this.eucm = column;
				this.eucm['checked'] = true;
			},

			// 点击某行背景改变开始
			tableRowClassName({
				row,
				rowIndex
			}) {
				row.index = rowIndex;
			},

			selectHeight({
				row,
				rowIndex
			}) {
				if (this.getIndex == rowIndex) {
					return {
						"background-color": "#CAE1FF"
					}
				}
			},
			// 点击某行背景改变结束
			/***************************核保意见 END**********************************************/

			/***************************照会 END**********************************************/
			//新增照会
			addPn(data) {
				if (this.wfCheckUw(data) == 0) {
					this.popMsg("错误!!!需要先增加核保意见!!!!!!", 'error');
					return false;
				}
				let ls_date = data.unipndPageList[0].lda_date;
				let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) + "-" + ls_date.substring(6, 8);
				let lt_time = uwJs.showTime();
				let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) + ":" + lt_time.substring(12, 14);
				let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);

				let clntnum = '';
				data.headClntnumList.forEach(item => {
					clntnum = item.clntnum;
					if (item.roleflag == "2") {
						clntnum = item.clntnum; //照会对象默认取被保人
					}
				})

				let index = data.eubas.length;
				let euba = {
					applnum: data.curApplnum,
					zresnpd: "",
					chdrnum: data.chdrnum,
					memodesc: (data.euaa.tsalesunt + uwJs.showTime().substring(2)),
					pndate: data.unipndPageList[0].lda_date,
					dateend: "0",
					forceind: "",
					resind: "",
					prtopt: "",
					zprtcert: "",
					reminddate: "0",
					remindflg: "N",
					crtuser: data.unipndPageList[0].userId,
					dtecrt: data.unipndPageList[0].lda_date,
					crttime: ll_time1,
					nofday: "0",
					source: "",
					jobName: uwconstant.jobName,
					userProfile: this.userId,
					datime: data.unipndPageList[0].lda_date,
					as_hand: "",
					clntnum: clntnum,
					pncode: "",
					procflg: "",
					pedesc: "",
					as_pndate: data.unipndPageList[0].lda_date,
					rprntdate: "0",
					userid: "",
					pnfrom: this.userId,
					as_dateend: "",
					pncodeBg: "F",
					pedescBg: "F",
					clntnumSelectBg: "B",
					num: index
				}
				data.eubas.push(euba);
			},

			//照会选择
			selectRow(row, colum, event) {
				let flag = false;

				this.multipleSelection.forEach(item => {
					if (item.index == row.index) {
						flag = true;
					}
				})
				if (!flag) {
					this.$refs.multipleTable[0].toggleRowSelection(colum, true);
				} else {
					// this.$refs.multipleTable[0].toggleRowSelection(colum,false);
				}

			},
			//删除照会
			delPn(data) {
				if (this.multipleSelection.length == 0) {
					this.popMsg("请选择您要删除的数据", 'error');
					return false;
				}
				this.multipleSelection.forEach(item => {
					let index = item.index;
					if (data.eubas[index].pntype == 1) {
						this.delPn1(data, index);
					} else if (data.eubas[index].pntype == 2) {
						this.delPn2(data, index);
					} else if (data.eubas[index].pntype == 3) {
						this.delPn3(data, index);
					} else {
						data.eubas = data.eubas.filter(euba => euba.index != index);
					}
				})
				console.log(data)
			},

			delPn1(data, index) {
				let pnfrom = data.eubas[index].pnfrom;
				let resind = data.eubas[index].resind;
				let rprntdate = data.eubas[index].rprntdate;
				let ls_pncode = data.eubas[index].pncode;
				let ls_chdrnum = data.eubas[index].chdrnum;
				let ls_clntnum = data.eubas[index].clntnum;


				if (pnfrom != data.unipndPageList[0].userId || resind == "N" || rprntdate > 0) {
					this.popMsg("警告：您不能删除该照会,原因可能是该照会非您所建、该照会已打印、该照会是蓝色照会或批注类照会!", 'error');
					return false;
				} else {

					if (pnfrom == "MAGNUM" || pnfrom == "AUW") {
						this.popMsg("讯息：系统所产生之照会代码不可删除", 'error');
						return false;
					}


					if (ls_pncode == "EE1") {
						//若批注类存在,不可删除
						if (data.eubas != null) {
							for (var i = 0; i < data.eubas.length; i++) {
								let euba = data.eubas[i];
								if (euba.pntype == "1") {
									if (ls_clntnum == euba.clntnum & "04" == euba.zresnpd) {
										this.popMsg("讯息：保单号码 (" + ls_chdrnum + ") 之被保险人 (" + ls_chdrnum + ") ~n批注明细存在不可删除",
											'error');
										return false;
									}
								}

							}
						}
					} else if (ls_pncode == "C01") {
						//point:牵扯到加费，尚未实现
						this.popMsg("讯息：加费原因存在不可删除", 'error');
						return false;
					} else if (ls_pncode == "Q43") {
						if (data.eubas != null) {
							for (var i = 0; i < data.eubas.length; i++) {
								let euba = data.eubas[i];
								if (euba.pntype == "1") {
									if (ls_clntnum == euba.clntnum & "07" == euba.zresnpd) {
										this.popMsg("讯息：被保险人 (" + ls_clntnum + ") 告知事项代码存在不可删除", 'error');
										return false;
									}
								}
							}
						}

					} else if (ls_pncode == "Q44") {
						if (data.eubas != null) {
							for (var i = 0; i < data.eubas.length; i++) {
								let euba = data.eubas[i];
								if (euba.pntype == "1") {
									if (ls_clntnum == euba.clntnum & "08" == euba.zresnpd) {
										this.popMsg("讯息：被保险人 (" + ls_clntnum + ") 问卷代码存在不可删除", 'error');
										return false;
									}
								}
							}
						}
					}

					data.eubas = data.eubas.filter(euba => euba.index != index);
				}
			},

			delPn2(data, index) {
				let pnfrom = data.eubas[index].pnfrom;
				let resind = data.eubas[index].resind;
				let rprntdate = data.eubas[index].rprntdate;
				if (pnfrom != data.unipndPageList[0].userId || resind == "N" || rprntdate > 0) {
					this.popMsg("警告：您不能删除该照会,原因可能是该照会非您所建、该照会已打印、该照会是蓝色照会或批注类照会!", 'error');
					return false;
				}
				data.eubas = data.eubas.filter(euba => euba.index != index);

			},

			delPn3(data, index) {
				let pnfrom = data.eubas[index].pnfrom;
				let resind = data.eubas[index].resind;
				let rprntdate = data.eubas[index].rprntdate;
				if (pnfrom != data.unipndPageList[0].userId || resind == "N" || rprntdate > 0) {
					this.popMsg("警告：您不能删除该照会,原因可能是该照会非您所建、该照会已打印、该照会是蓝色照会或批注类照会!", 'error');
					return false;
				}
				data.eubas = data.eubas.filter(euba => euba.index != index);
			},
			//更改照会类型
			changePntype(value, pageData, data) {
				data.pntype = value;
				//为防止用户先填写照会码再选择照会类型导致pntype为空无法进行照会的相关赋值操作，这里需要再次调用一下
				this.changePncode(pageData, data);
			},
			//更改照会代码
			changePncode(pageData, data) {
				if (data.pncode == '' || data.pncode == undefined || data.pncode == "undefined") {
					return false;
				}
				if (data.pntype == '' || data.pntype == undefined || data.pntype == "undefined") {
					data.pncode = '';
					return false;
				}
				let ll_count = pageData.initPageDateList[0].countScf4pkyByApplnum == null ? 0 : pageData.initPageDateList[
					0].countScf4pkyByApplnum;
				if (ll_count > 0) {
					let ls_ind32 = pageData.initPageDateList[0].findInd32FromScf4pky == null ? 0 : pageData
						.initPageDateList[0].findInd32FromScf4pky;
					if (ls_ind32 == "1") {
						if (pageData.unipndPageList[0].is_Uwlevel < "6") {
							this.popMsg("信息：只有核保授权等级为5级及5级以上的核保人员才能处理私人银行照会!", 'error');
							return false;
						}
					}
				}

				if (data.pncodeBg.indexOf("R") != -1) {
					return false;
				}

				if (data.pncode != data.pncodeOld) {
					this.pnIndex = data.index;
					this.changePncodeTemp(pageData, data);
				}
				this.pageModifyFlag = true;
			},

			//照会事项
			changePncode1(pageData, data) {
				let that = this;
				let ls_pnfrom = data.pnfrom;
				let ls_pncode = data.pncodeOld;
				if (ls_pnfrom == "AUW" || ls_pnfrom == "MAGNUM" || ls_pncode == "EE1" || ls_pncode == "C01" || ls_pncode ==
					"Q43" || ls_pncode == "Q44") {
					that.popMsg("讯息：照会代码 (" + ls_pncode + ") 为系统所产生不可新增或变更", 'error');
					data.pncode = ls_pncode; //还原
					return false;
				}

				if (data.pncode == "") {
					that.popMsg("错误：照会代码不可为空白", 'error');
					return false;
				}

				if (data.pncode == "EE1" || data.pncode == "C01" || data.pncode == "Q43" || data.pncode == "Q44") {
					that.popMsg("讯息：输入之照会代码 (" + data.pncode + ") 为系统自动产生,不可自行输入", 'error');
					data.pncode = "";
					return false;
				}


				let params = {
					"pncode": data.pncode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params);
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}
				if (lds_pn == null || lds_pn == "") {
					that.popMsg("讯息：照会代码 (" + data.pncode + ") 不存在", 'error');
					data.pncode = "";
					return false;
				}
				if (lds_pn.zresnpd == "04") {
					that.popMsg("错误：不可在此新增批注类照会", 'error');
					data.pncode = "";
					return false;
				}

				if (lds_pn.zresnpd == "04" && this.curData.eufgpkyVO.excflag != "Y") {
					that.popMsg("错误：没有权限使用该类型照会", 'error');
					data.pncode = "";
					return false;
				}

				if (lds_pn.zresnpd == "07" || lds_pn.zresnpd == "08") {
					that.popMsg("错误：输入之照会代码 (" + data.pncode + ") 不归属照会事项类", 'error');
					data.pncode = "";
					return false;
				}

				if (lds_pn.zresnpd == "06") { //提示性照会
					that.popMsg("错误：不可在此新增提示性类照会", 'error');
					data.pncode = "";
					return false;
				}

				if (lds_pn.resind == "N") {
					that.popMsg("警告!您不能手工输入蓝色或红色照会的代码!", 'error');
					data.pncode = "";
					return false;
				}


				let count = 0;
				let params1 = {
					"pncode": data.pncode
				}
				let res1 = uwLoadJs.countEuhcByPncodeAndFlag01(params1);
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					count = res1.data;
				}
				if (count > 0) {
					let ls_flg1 = this.curData.initPageDateList[0].flag1;
					let ls_flg3 = this.curData.initPageDateList[0].flag2;
					if ((ls_flg1.trim == "" || ls_flg1.trim == "N") && ls_flg3 == "Y") {
						that.popMsg("警告!此照会为B类照会，你无权处理!", 'error');
						data.pncode = "";
						return false;
					}
				}

				let lda_reminddate = "0";
				let params2 = {
					"ls_date": pageData.unipndPageList[0].lda_date,
					"ll_remindday": lds_pn.remindday + ""
				}
				let res2 = uwLoadJs.deteRoll(params2);
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					lda_reminddate = res2.data;
				}
				pageData.eubas[that.pnIndex].zresnpd = lds_pn.zresnpd;
				pageData.eubas[that.pnIndex].pedesc = lds_pn.pedesc;
				pageData.eubas[that.pnIndex].memodesc = pageData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					pageData.eubas[that.pnIndex].memodesc = ("$$$$$" + uwJs.showTime().substring(2));
				}
				pageData.eubas[that.pnIndex].pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].as_pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].procflg = "";
				pageData.eubas[that.pnIndex].dateend = "0";
				pageData.eubas[that.pnIndex].as_dateend = "0";
				pageData.eubas[that.pnIndex].forceind = lds_pn.forceind;
				pageData.eubas[that.pnIndex].resind = lds_pn.resind;
				pageData.eubas[that.pnIndex].prtopt = lds_pn.prtopt;
				pageData.eubas[that.pnIndex].zprtcert = lds_pn.authnow;
				pageData.eubas[that.pnIndex].nofday = lds_pn.nofday;
				pageData.eubas[that.pnIndex].source = lds_pn.source;
				pageData.eubas[that.pnIndex].userid = "";
				pageData.eubas[that.pnIndex].reminddate = Number(lda_reminddate);
				pageData.eubas[that.pnIndex].remindflg = "N";
				pageData.eubas[that.pnIndex].chdrnum = pageData.chdrnum;
				pageData.eubas[that.pnIndex].as_hand = pageData.eufgpkyVO.forceind;
				pageData.eubas[that.pnIndex].pncodeOld = ls_pncode;
				pageData.eubas[that.pnIndex].crtuser = this.userid;


				console.log(this.pageData)
			},

			//问卷代码
			changePncode2(pageData, data) {
				let that = this;
				let ls_pnfrom = data.pnfrom;
				let ls_pncode = data.pncodeOld;
				if (ls_pnfrom == "AUW" || ls_pnfrom == "MAGNUM") {
					that.popMsg("讯息：照会代码 (" + ls_pncode + ") 为系统所产生不可新增或变更", 'error');
					data.pncode = ls_pncode; //还原
					return false;
				}

				if (data.pncode == "") {
					that.popMsg("错误：照会代码不可为空白", 'error');
					return false;
				}

				let params = {
					"pncode": data.pncode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params);
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}
				if (lds_pn == null) {
					that.popMsg("讯息：照会代码 (" + data.pncode + ") 不存在", 'error');
					data.pncode = "";
					return false;
				}
				if (lds_pn.zresnpd != "08") {
					that.popMsg("输入之照会代码 (" + data.pncode + ") 不归属问卷类", 'error');
					data.pncode = "";
					return false;
				}
				if (lds_pn.resind == "N") {
					that.popMsg("警告!您不能手工输入蓝色或红色照会的代码!", 'error');
					data.pncode = "";
					return false;
				}

				let count = 0;
				let params1 = {
					"pncode": data.pncode
				}
				let res1 = uwLoadJs.countEuhcByPncodeAndFlag01(params1);
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					count = res1.data;
				}
				if (count > 0) {
					let ls_flg1 = this.curData.initPageDateList[0].flag1;
					let ls_flg3 = this.curData.initPageDateList[0].flag2;
					if ((ls_flg1.trim == "" || ls_flg1.trim == "N") && ls_flg3 == "Y") {
						that.popMsg("警告!此照会为B类照会，你无权处理!", 'error');
						data.pncode = "";
						return false;
					}
				}


				let lda_reminddate = "0";
				let params2 = {
					"ls_date": pageData.unipndPageList[0].lda_date,
					"ll_remindday": lds_pn.remindday + ""
				}
				let res2 = uwLoadJs.deteRoll(params2);
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					lda_reminddate = res2.data;
				}

				pageData.eubas[that.pnIndex].zresnpd = lds_pn.zresnpd;
				pageData.eubas[that.pnIndex].pedesc = lds_pn.pedesc;
				pageData.eubas[that.pnIndex].memodesc = pageData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					pageData.eubas[that.pnIndex].memodesc = ("$$$$$" + uwJs.showTime().substring(2));
				}

				pageData.eubas[that.pnIndex].pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].as_pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].procflg = "";
				pageData.eubas[that.pnIndex].dateend = "0";
				pageData.eubas[that.pnIndex].as_dateend = "0";
				pageData.eubas[that.pnIndex].forceind = lds_pn.forceind;
				pageData.eubas[that.pnIndex].resind = lds_pn.resind;
				pageData.eubas[that.pnIndex].prtopt = lds_pn.prtopt;
				pageData.eubas[that.pnIndex].zprtcert = lds_pn.authnow;
				pageData.eubas[that.pnIndex].nofday = lds_pn.nofday;
				pageData.eubas[that.pnIndex].source = lds_pn.source;
				pageData.eubas[that.pnIndex].userid = "";
				pageData.eubas[that.pnIndex].reminddate = Number(lda_reminddate);
				pageData.eubas[that.pnIndex].remindflg = "N";
				pageData.eubas[that.pnIndex].chdrnum = pageData.chdrnum;
				pageData.eubas[that.pnIndex].as_hand = pageData.eufgpkyVO.forceind;
				pageData.eubas[that.pnIndex].pncodeOld = ls_pncode;
				pageData.eubas[that.pnIndex].crtuser = this.userid;


			},

			//声明书代码
			changePncode3(pageData, data) {
				let that = this;
				let ls_pnfrom = data.pnfrom;
				let ls_pncode = data.pncodeOld;
				if (ls_pnfrom == "AUW" || ls_pnfrom == "MAGNUM") {
					that.popMsg("讯息：照会代码 (" + ls_pncode + ") 为系统所产生不可新增或变更", 'error');
					data.pncode = ls_pncode; //还原
					return false;
				}

				if (data.pncode == "") {
					that.popMsg("错误：照会代码不可为空白", 'error');
					return false;
				}


				let params = {
					"pncode": data.pncode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params);
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}
				if (lds_pn == null) {
					that.popMsg("讯息：照会代码 (" + data.pncode + ") 不存在", 'error');
					data.pncode = "";
					return false;
				}
				if (lds_pn.zresnpd != "07") {
					that.popMsg("输入之照会代码 (" + data.pncode + ") 不归属声明书类", 'error');
					data.pncode = "";
					return false;
				}
				if (lds_pn.resind == "N") {
					that.popMsg("警告!您不能手工输入蓝色或红色照会的代码!", 'error');
					data.pncode = "";
					return false;
				}

				let count = 0;
				let params1 = {
					"pncode": data.pncode
				}
				let res1 = uwLoadJs.countEuhcByPncodeAndFlag01(params1);
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					count = res1.data;
				}
				if (count > 0) {
					let ls_flg1 = this.curData.initPageDateList[0].flag1;
					let ls_flg3 = this.curData.initPageDateList[0].flag2;
					if ((ls_flg1.trim == "" || ls_flg1.trim == "N") && ls_flg3 == "Y") {
						that.popMsg("警告!此照会为B类照会，你无权处理!", 'error');
						data.pncode = "";
						return false;
					}
				}

				let lda_reminddate = "0";
				let params2 = {
					"ls_date": pageData.unipndPageList[0].lda_date,
					"ll_remindday": lds_pn.remindday + ""
				}
				let res2 = uwLoadJs.deteRoll(params2);
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					lda_reminddate = res2.data;
				}
				pageData.eubas[that.pnIndex].zresnpd = lds_pn.zresnpd;
				pageData.eubas[that.pnIndex].pedesc = lds_pn.pedesc;
				pageData.eubas[that.pnIndex].memodesc = pageData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					pageData.eubas[this.pnIndex].memodesc = ("$$$$$" + uwJs.showTime().substring(2));
				}

				pageData.eubas[that.pnIndex].pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].as_pndate = pageData.unipndPageList[0].lda_date;
				pageData.eubas[that.pnIndex].procflg = "";
				pageData.eubas[that.pnIndex].dateend = "0";
				pageData.eubas[that.pnIndex].as_dateend = "0";
				pageData.eubas[that.pnIndex].forceind = lds_pn.forceind;
				pageData.eubas[that.pnIndex].resind = lds_pn.resind;
				pageData.eubas[that.pnIndex].prtopt = lds_pn.prtopt;
				pageData.eubas[that.pnIndex].zprtcert = lds_pn.authnow;
				pageData.eubas[that.pnIndex].nofday = lds_pn.nofday;
				pageData.eubas[that.pnIndex].source = lds_pn.source;
				pageData.eubas[that.pnIndex].userid = "";
				let ll_reminddate = Number(lda_reminddate);
				pageData.eubas[that.pnIndex].reminddate = ll_reminddate;
				pageData.eubas[that.pnIndex].remindflg = "N";
				pageData.eubas[that.pnIndex].chdrnum = pageData.chdrnum;
				pageData.eubas[that.pnIndex].as_hand = pageData.eufgpkyVO.forceind;
				pageData.eubas[that.pnIndex].zresnpd = lds_pn.zresnpd;
				pageData.eubas[that.pnIndex].pncodeOld = ls_pncode;
				pageData.eubas[that.pnIndex].crtuser = this.userid;

			},

			//校验照会代码
			changePncodeTemp(pageData, data) {
				if (data.pntype == "1") {
					this.changePncode1(pageData, data);
				} else if (data.pntype == "2") {
					this.changePncode2(pageData, data);
				} else if (data.pntype == "3") {
					this.changePncode3(pageData, data);
				}
			},
			//一键核销
			allEuabX(pageData) {
				let eubas = pageData.eubas;
				for (var e in eubas) {
					let euba = eubas[e];
					if (euba.procflgBg != 'RR' && euba.procflg == '') {
						euba.procflg = 'X';
						this.changeProcflg(pageData, euba);
					}
				}
			},
			//处理码改变事件
			changeProcflg(pageData, data) {
				this.pageModifyFlag = true;
				let ll_count = pageData.initPageDateList[0].countScf4pkyByApplnum == null ? 0 : pageData.initPageDateList[
					0].countScf4pkyByApplnum;
				if (ll_count > 0) {
					let ls_ind32 = pageData.initPageDateList[0].findInd32FromScf4pky == null ? 0 : pageData
						.initPageDateList[0].findInd32FromScf4pky;
					if (ls_ind32 == "1") {
						if (pageData.unipndPageList[0].is_Uwlevel < "6") {
							this.popMsg("信息：只有核保授权等级为5级及5级以上的核保人员才能处理私人银行照会!", 'error');
							return false;
						}
					}
				}

				let procflg = data.procflg;

				if (procflg != "") {
					data.procflg = procflg.toUpperCase();

					if (data.procflg != "O" && data.procflg != "X" && data.procflg != data.oldProcflg) {
						this.popMsg("错误：处理码输入错误", 'error');
						data.procflg = "";
						return false;
					} else {
						let params1 = {
							"pncode": data.pncode
						}
						countEuhcByPncodeAndFlag01(params1).then(res => {
							if (res.resultCode == constant.SUCCESS && res.data) {
								let count = res.data;
								if (count > 0) {

									let ls_flg1 = pageData.initPageDateList[0].flag1;
									let ls_flg3 = pageData.initPageDateList[0].flag2;
									if ((ls_flg1.trim() == "" || ls_flg1.trim() == "N") && ls_flg3 == "Y") {
										this.popMsg("警告!此照会为B类照会，你无权处理!", 'error');
										data.procflg = data.oldProcflg;
										return false;
									}
								}
							}
							data.dateend = pageData.unipndPageList[0].lda_date;
							data.as_dateend = pageData.unipndPageList[0].lda_date;
						}).catch(err => {
							console.log(err)
						});

					}
				} else {
					data.dateend = "0";
					data.as_dateend = "0";
				}
			},

			//处理码向上聚焦
			procflgUpKey(pageData, data) {
				let procflg = "procflg" + (Number(data.index) - 1);
				let i = (Number(data.index) - 1);
				if (i < 0) {
					return false;
				}
				console.log(this.$refs[procflg])
				this.$nextTick(() => {
					console.log(this.$refs[procflg])
					this.$refs[procflg][0].focus();
					console.log(this.$refs[procflg])
				}, 100)
			},
			//处理码向下聚焦
			procflgDownKey(pageData, data) {
				let procflg = "procflg" + (Number(data.index) + 1);
				let i = (Number(data.index) + 1);
				if (i >= pageData.eubas.length) {
					return false;
				}
				// let p = this.$refs[procflg];
				this.$nextTick(() => {
					console.log(this.$refs[procflg])
					this.$refs[procflg][0].focus();
					console.log(this.$refs[procflg])
				}, 100)
			},

			//照会对象校验
			changeClntnum(pageData, data) {
				let ll_count = pageData.initPageDateList[0].countScf4pkyByApplnum == null ? 0 : pageData.initPageDateList[
					0].countScf4pkyByApplnum;
				if (ll_count > 0) {
					let ls_ind32 = pageData.initPageDateList[0].findInd32FromScf4pky == null ? 0 : pageData
						.initPageDateList[0].findInd32FromScf4pky;
					if (ls_ind32 == "1") {
						if (pageData.unipndPageList[0].is_Uwlevel < "6") {
							this.popMsg("信息：只有核保授权等级为5级及5级以上的核保人员才能处理私人银行照会!", 'error');
							return false;
						}
					}
				}

				let ls_pncode = data.pncode;
				let ls_pnfrom = data.pnfrom;
				if (ls_pnfrom == "AUW" || ls_pnfrom == "MAGNUM") {
					this.popMsg("讯息：照会代码 (" + ls_pncode + ") 为系统所产生不可变更主被保险人", 'error');
					return false;
				} else {

				}
			},

			//显示选中的照会码
			showPncode(row, column, event) {
				this.curData.eubas[this.pnIndex].pncode = row.pncode;
				this.curData.eubas[this.pnIndex].pedesc = row.pedesc;
				this.changePncode(this.curPageData, this.curData.eubas[this.pnIndex]);
				this.opinionDialogVisible8 = false;
			},

			//Tap 键填充照会信息
			tapPncode() {
				debugger
				if (this.opinionDialogVisible8 && this.pnCodes.length == 1) {
					let row = this.pnCodes[0];
					this.curData.eubas[this.pnIndex].pncode = row.pncode;
					this.curData.eubas[this.pnIndex].pedesc = row.pedesc;
					this.changePncode(this.curPageData, this.curData.eubas[this.pnIndex]);
					this.opinionDialogVisible8 = false;
				}
			},

			//照会码输入自动查询
			layoutAutoComplate(data) {
				this.paginations.pageIndex = 1;
				this.paginations.pageSize = 15;

				let params = {
					"pageSize": this.paginations.pageSize,
					"pageNumber": this.paginations.pageIndex,
					"pntype": data.pntype,
					"pncode": data.pncode,
					"pedesc": "",
				}
				findPageByDimSelect(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						this.pnCodes = res.data.rows;
						this.paginations.total = res.data.total
					}

				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})
			},

			//照会码查询
			searchPncode(pncode) {
				this.tbloading = true;
				let params = {
					"pageSize": this.paginations.pageSize,
					"pageNumber": this.paginations.pageIndex,
					"pntype": this.paginations.pntype,
					"pncode": "",
					"pedesc": this.paginations.pndesc,
				}
				if (this.paginations.pncode) {
					params['pncode'] = this.paginations.pncode;
				}
				findPageByDimSelect(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						this.pnCodes = res.data.rows;
						this.paginations.total = res.data.total
					}
					this.tbloading = false;
				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})
			},

			//重置照会码查询
			refreshPncode() {
				this.paginations.pndesc = "";
				this.paginations.pncode = "";
			},
			// 点击照会代码弹框
			showPicList(e, index, data, pageData) {
				this.selectPncode = data;
				this.curData = pageData;
				this.pnIndex = index;
				this.paginations.pndesc = "";

				//查询
				if (data.pntype != "" && data.pntype != undefined) {
					this.paginations.pntype = data.pntype;
				} else {
					this.popMsg("请选择照会类型", 'error');
					data.pncode = '';
					return false;
				}
				this.paginations.pageIndex = 1; // 当前位于哪页
				this.paginations.pageSize = 15;
				this.searchPncode();

				console.log(this.$)
				console.log(e)
				console.log(index)
				this.opinionDialogVisible8 = true;
				// console.log(this.getTop(e))
				console.log(this.$refs['picSelect' + index]);
				this.gobalEle = this.$refs['picSelect' + index];
				let offset = this.$(this.$refs['picSelect' + index]).offset();
				console.log(this.$(this.$refs['picSelect' + index]).offset())
				this.$nextTick(() => {
					this.$('.select-main').offset({
						top: offset.top + 35,
						left: offset.left
					})
				})

			},

			// 照会代码弹框
			getTop(element) {
				var actualTop = element.offsetTop;
				var parent = element.offsetParent;
				while (parent != null) {
					actualTop += parent.offsetTop + (parent.offsetHeight - parent.clientHeight) / 2;
					parent = parent.offsetParent;
				}
				return actualTop;
			},

			// 照会代码
			rowClassName({
				row,
				rowIndex
			}) {
				row.index = rowIndex;
			},

			// 照会代码弹框切换页面
			handleCurrentChange(page) {
				this.paginations.pageIndex = page;
				this.searchPncode();
			},

			// 照会代码弹框切换每页数据大小
			handleSizeChange(pageSize) {
				this.paginations.pageSize = pageSize;
				this.searchPncode();
			},

			//核准
			appindChanged(data) {
				let that = this;
				that.subUnLoading = true;
				this.pageModifyFlag = true;
				let ls_ind32 = "";
				this.appindChangedTimeOut = setTimeout(function() {
					//1.如查PVY保单，则必须要核保等级>=9级人员进行核保
					let ll_count = data.initPageDateList[0].countScf4pkyByApplnum == null ? 0 : data
						.initPageDateList[0].countScf4pkyByApplnum;
					if (ll_count > 0) {
						ls_ind32 = data.initPageDateList[0].findInd32FromScf4pky == null ? 0 : data
							.initPageDateList[0].findInd32FromScf4pky;
						if (ls_ind32 == "1") {
							if (data.unipndPageList[0].is_Uwlevel < "6") {
								that.popMsg("只有核保授权等级为5级及5级以上的核保人员才能处理私人银行照会", 'error');
								data.appind = "N";
								that.subUnLoading = false;
								return false;
							}
						}
					}

					//2.中信信用卡VIP项目
					if (ls_ind32 == "2") { //中信VIP
						if (confirm("该单为中信信用卡VIP客户，需电话核保，请确认是否需发照会!")) {
							//系统保存相关信息并可打印照会
						} else {
							//系统不保存信息
							data.appind = "N";
							that.subUnLoading = false;
							return false;
						}
					}

					//
					let pncodes = "";
					if (data.eubas.length > 0) {
						data.eubas.forEach(euba => {
							if (pncodes == "") {
								pncodes = euba.pncode + ",";
							} else {
								pncodes = pncodes + euba.pncode + ",";
							}
						})
					}
					if (pncodes.indexOf(",") != -1) {
						pncodes = pncodes.substring(0, pncodes.length - 1);
					}
					let params1 = {
						"pncode": pncodes
					}

					let count = 0;
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/countEuhcByPncodeAndFlag01';
					let res = uwLoadJs.ajaxRequest(params1, url);
					if (res == null) {
						return false;
					}
					count = res.data;


					//B类照会
					let ls_flag1 = "";
					if (count == 0) {
						ls_flag1 = "A";
					} else {
						ls_flag1 = "B";
					}
					if (data.eubas.length > 0 && ls_flag1 == "B") {
						let ls_flg1 = data.initPageDateList[0].flag1;
						let ls_flg3 = data.initPageDateList[0].flag2;
						if ((ls_flg1.trim() == "" || ls_flg1.trim() == "N") && ls_flg3 == "Y") {
							that.popMsg("讯息：存在B类照会，不能核发", 'error');
							data.appind = "N";
							that.subUnLoading = false;
							return false;
						}
					}


					if (data.appind == "Y") {
						let ls_med02 = "";
						let ls_med03 = "";

						data.eubas.forEach(euba => {
							if (euba.procflg == "" && euba.rprntdate == "0" &&
								euba.zresnpd == "02" && ls_med02 != "1") {
								ls_med02 = "1";
							}

							if (euba.procflg == "" && euba.rprntdate == "0" &&
								euba.zresnpd == "03" && ls_med03 != "1") {
								ls_med03 = "1";
							}

							if (euba.procflg == "" && Number(euba.rprntdate) > 0) {
								let ls_pncode = euba.pncode;
								that.popMsg("讯息：照会代码" + ls_pncode + "已打印,但是尚未核销!!!!", 'error');
							}
						});

						if (ls_med02 == "1" && ls_med03 == "") {
							that.popMsg("讯息：有体检原因，无体检项目!!!!", 'error');
							data.appind = "N";
							that.subUnLoading = false;
							return false;
						}

						if (ls_med02 == "" && ls_med03 == "1") {
							that.popMsg("讯息：有体检项目，无体检原因!!!!", 'error');
							data.appind = "N";
							that.subUnLoading = false;
							return false;
						}

						let eubas = [];
						data.eubas.forEach(euba => {
							if (euba.pndate <= data.unipndPageList[0].lda_date &&
								euba.procflg == "" &&
								Number(euba.rprntdate) == 0) {
								let params = {
									"pncode": euba.pncode
								}
								let lds_pn = null;
								let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params);
								if (res == null) {
									return false;
								}
								if (res.resultCode == constant.SUCCESS && res.data != null) {
									lds_pn = res.data;
								}

								if (lds_pn == null || lds_pn == "") {
									that.popMsg("讯息：照会代码 (" + euba.pncode + ") 读取错误", 'error');
									data.appind = "N";
									that.subUnLoading = false;
									return false; //point:这里是自己加的，pb中没有
								}

								let params2 = {
									"ls_date": data.unipndPageList[0].lda_date,
									"ll_remindday": lds_pn.remindday + ""
								}
								let lda_reminddate = "0";
								let res1 = uwLoadJs.deteRoll(params2);
								if (res1 == null) {
									return false;
								}
								if (res1.resultCode == constant.SUCCESS && res1.data != null) {
									lda_reminddate = res1.data;
								}

								let ls_date = data.unipndPageList[0].lda_date;
								let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) +
									"-" + ls_date.substring(6, 8);
								let lt_time = uwJs.showTime();
								let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) +
									":" + lt_time.substring(12, 14);
								let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) +
									lt_time.substring(12, 14);

								euba.reminddate = Number(lda_reminddate);
								euba.remindflg = "N";
								euba.rprntdate = "0";
								euba.pndate = data.unipndPageList[0].lda_date;
								euba.as_pndate = data.unipndPageList[0].lda_date;
								euba.userid = data.unipndPageList[0].userId;
								euba.crtuser = data.unipndPageList[0].userId;
								euba.dtecrt = data.unipndPageList[0].lda_date;
								euba.crttime = ll_time1;
								euba.userProfile = data.unipndPageList[0].userId;
								euba.jobName = uwconstant.jobName;
								euba.datime = that.initTime();
							}
							eubas.push(euba);
						});

						data.eubas = eubas;


						//检查是否有未结案可供照会
						let ls_close = "Y";
						data.eubas.forEach(item => {
							//if (item.procflg == "" && item.zresnpd != "04") {
							if (item.procflg == "") {
								ls_close = "N";
							}
						});
						if (ls_close == "Y") {
							// data.oldEubas.forEach(item => {
							//   //if (item.pntype == "1" && item.procflg == "" && item.zresnpd != "04") {
							//   if (item.pntype == "1" && item.procflg == ""){//批注照会处理码为空也可以核准
							//     ls_close = "N";
							//   }
							// });
							// if (ls_close == "Y") {
							that.popMsg("讯息：照会代码均已结案,无须照会", 'error');
							data.appind = "N";
							that.subUnLoading = false;
							return false;
							// }
						}

						//处理状态为照会
						data.euaa.procflg = "3";
						//催办日仅第一次(或日期为0)须预设
						let ll_perenddt = data.euaa.perenddt;
						if (ll_perenddt == 0 || ll_perenddt == 99999999) {
							let params3 = {
								"ls_date": data.unipndPageList[0].lda_date,
								"ll_remindday": "7"
							}
							let lda_perenddt = "0";
							let res1 = uwLoadJs.deteRoll(params3);
							if (res1 == null) {
								return false;
							}
							if (res1.resultCode == constant.SUCCESS && res1.data != null) {
								lda_perenddt = res1.data;
							}

							data.euaa.perenddt = lda_perenddt;
							data.euaa.as_perenddt = lda_perenddt;
						}

						//照会日期
						data.euaa.pnappdate = data.unipndPageList[0].lda_date;
						//受理号
						let ls_applnum = data.euaa.applnum;
						//照会回复日期
						let pnrpdate = that.createPnrpdate(data);
						data.euaa.pnBackDate = pnrpdate;

						let agntnum01 = data.euaa.agntnum01;
						if (agntnum01 != null) {
							let params20 = {
								"aagtnum": agntnum01,
								"agntcoy": uwJs.space(1),
								"agnum": uwJs.space(8),
								"name": uwJs.space(30),
								"offcd": uwJs.space(5),
								"offnm": uwJs.space(30),
								"breaks": uwJs.space(1),
								"agcls": uwJs.space(4),
								"flag": uwJs.space(1),
								"servyr": uwJs.space(8),
								"rtnsts": uwJs.space(4),
								"rtncd": uwJs.space(1),
								"branch": uwJs.space(8),
							}
							callEuis020(params20).then(res => {
								if (res.data != null && res.data.rtnsts.trim() == "" || res.data.rtnsts ==
									null) {
									if (null != res.data.offcd) {
										data.euaa.agtydesc01 = res.data.offnm.trim();
										data.euaa.as_agntname01 = data.euaa.agntname01 + "/" + res.data
											.offnm.trim();
										data.euaa.tsalesunt = res.data.offcd.trim();
										data.euaa.tsalesdsc = res.data.offnm.trim();
										data.euaa.tsalesdsc1 = res.data.offcd.trim() + "/" + res.data.offnm
											.trim();
									}
								}
							}).catch(err => {
								// this.loading = false;
								console.log(err)
							})

						}

					} else {
						//处理状况-还原
						let ls_procflg = data.euaa.procflg;
						if (ls_procflg == "3") {
							data.euaa.procflg = "3"; //照会
						} else {
							data.euaa.procflg = "2"; //核保
						}

						//催办日-还原
						let ll_perenddt_old = data.euaa.as_perenddt;
						let ll_perenddt = data.euaa.perenddt;
						if (ll_perenddt != ll_perenddt_old) {
							data.euaa.perenddt = ll_perenddt_old;
						}

						//照会日期-还原
						data.euaa.pnappdate = data.euaa.as_pnappdate;
						data.euaa.pnBackDate = data.euaa.as_pnBackDate;
					}

					console.log(that.pageData);
					that.$nextTick(() => {
						that.$set(data, 'appind', data['appind']);
						that.$forceUpdate();
					})
					that.subUnLoading = false;
				}, 100);
			},

			//照会回复日期
			createPnrpdate(data) {
				let rpdateStr = "0";
				//当前日期busidate
				let busidate = new Date();
				let busidate_str = data.unipndPageList[0].lda_date; //
				let year = parseInt(busidate_str.substring(0, 4), 10);
				let month = parseInt(busidate_str.substring(4, 6), 10);
				let day = parseInt(busidate_str.substring(6, 8), 10);
				busidate.setFullYear(year, month - 1, day);
				//受理日期
				let hprrcvdt_str = data.euaa.hprrcvdt + "";
				let hprrcvdt = new Date();
				hprrcvdt.setFullYear(parseInt(hprrcvdt_str.substring(0, 4)), parseInt(hprrcvdt_str.substring(4, 6)) - 1,
					parseInt(hprrcvdt_str.substring(6, 8)));

				//上线时间点 20160301
				let flag_date = new Date();
				flag_date.setFullYear(2016, 2, 1); //20160301为新流程执行日期


				let tempdate = 0;
				tempdate = busidate.getTime() + 30 * 24 * 60 * 60 * 1000; //当前日期+30天
				// let flag = this.checkStatus(data);
				// if (flag || hprrcvdt < flag_date) {//受理日期小于20160301，还按照原有的30天作为照会回复截止日期
				//   tempdate = busidate.getTime() + 30 * 24 * 60 * 60 * 1000;//当前日期+30天
				// } else {//照会回复截至日期为
				//   let srcebus = data.euaa.srcebus;
				//   if (srcebus == 'FC') {//银保渠道回复时效调整为15个自然日
				//     tempdate = busidate.getTime() + 15 * 24 * 60 * 60 * 1000;//当前日期+15天
				//   } else {
				//     tempdate = busidate.getTime() + 10 * 24 * 60 * 60 * 1000;//当前日期+10天
				//   }
				// }

				//计算后的日期
				let rpdate = new Date(tempdate);
				year = rpdate.getFullYear();
				month = rpdate.getMonth() + 1;
				let monthstr = month < 10 ? "0" + month : month + "";
				day = rpdate.getDate() < 10 ? "0" + rpdate.getDate() : rpdate.getDate() + "";
				rpdateStr = year + "" + monthstr + "" + day;
				let o_rpdateStr = data.euaa.pnrpdate;
				let o_rpdate = o_rpdateStr == "" ? 0 : parseInt(o_rpdateStr);
				let n_rpdate = parseInt(rpdateStr);
				if (o_rpdate < 99999999) {
					rpdateStr = o_rpdate > n_rpdate ? o_rpdateStr : rpdateStr;
				}
				return rpdateStr;
			},

			/***************************照会 END**********************************************/

			dyClass() {
				return 1;
			},



			/***************************加费除外BEGIN**********************************************/
			//返回
			ppBack() {
				let mark = 'N';
				//如果计算完加费后没有做任何操作，弹框被关闭了，则移除缓存中该条险种加费记录
				if (this.curAddPremObj['isTryAdd'] == 'Y') {
					mark = 'Y';
					//还原之前的加费情况
					if (this.curAddPremObj['premList'].length > 0) {
						this.premiumTempList.forEach(euah => {
							this.curAddPremObj['premList'].forEach(temp => {
								//将该核保员名下的该加费信息还原成计算前时候值
								if (euah.polpln == temp.polpln && euah.remark02 == temp.remark02) {
									if (!euah['isDeal'] && euah['isDeal'] != 'Y') {
										euah['isDeal'] = 'N';
									}
									if (euah.seqnbr == temp.seqnbr) {
										let params1 = {
											"applnum": temp.applnum,
											"chdrnum": temp.chdrnum,
											"clntnum": temp.clntnum,
											"polpln": temp.polpln,
											"seqnbr": temp.seqnbr,
											"remark02": temp.remark02,
											"zlinstprem": temp.zlinstprem, //次标加费,
											"opcda": temp.opcda, //
											"extCessTerm": temp.extCessTerm, //
											"insprm": temp.insprm, //
											"oppc": temp.oppc,
											"zmortpct": temp.zmortpct //
										}
										let url2 = appName.NEWUNDR +
											'/unipnd/premium/updatePremiumTempWithCalc1';
										let res2 = uwLoadJs.ajaxRequest(params1, url2);
										euah['isDeal'] = 'Y';
									}
								}
							})
						})
						this.premiumTempList.forEach(eu => {
							//如果该核保员还执行了新增的其他加费，则删除掉
							if (eu.isDeal == 'N' && eu.remark02 == this.userId) {
								let params1 = {
									"applnum": eu.applnum,
									"chdrnum": eu.chdrnum,
									"clntnum": eu.clntnum,
									"polpln": eu.polpln,
									"seqnbr": eu.seqnbr,
									"remark02": eu.remark02,
								}
								let url2 = appName.NEWUNDR + '/unipnd/premium/deletePremiumTempWithCalc';
								let res2 = uwLoadJs.ajaxRequest(params1, url2);
								euah['isDeal'] = '';
							}
						});
					}
					this.curAddPremObj['isTryAdd'] = 'N'
					this.curAddPremObj['premList'] = [];
					this.callPremBase = null;
					this.callPremEuabs = [];
					this.callPremEuahs = [];
				}
				let euabs = [];
				this.curPostilData.trailer4.forEach(item => {
					if (this.curPostilObj.crtable == item.crtable) {
						console.log("记录核保结论:" + item.approval);
						item.approval = item.oldapproval;
						// item.approval = "";
						item.oldapproval = "B";
						if (this.premiumTempList.length > 0) {
							let total = 0;
							this.premiumTempList.forEach(euah => {
								if (euah.polpln == this.curAddPremObj.polpln && euah.remark02 == this
									.userId) {
									total += Number(euah.zlinstprem);
								}
							})
							if (total == 0 && (item.approval == 'A' || item.approval == 'B') && item.isUWFlag ==
								"0") {
								item.approval = "";
								this.popMsg("错误信息!!加费金额为0,请重新选择该险种的险种核保结论", 'error')
							}
							if (total == 0 && mark == 'Y' && item.isUWFlag == "0") {
								item.approval = "";
							}
						} else {
							item.approval = "";
						}
					}
					euabs.push(item);
				})
				this.curPostilData.trailer4 = euabs;
				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == this.curPostilData.curApplnum) {
						datas.push(this.curPostilData);
					} else {
						datas.push(item);
					}
				})

				this.pageData = datas;
				this.initPolicyConclusions(this.curPostilData);
				this.ppFlag = false;
			},
			//打开弹窗
			openPPDioag(pageData, data, index) {
				let that = this;
				that.curPostilData = pageData;
				that.curPostilObj = data;
				if (pageData.unipndPageList[0].is_option == "DSP") {
					this.isPostilAdd = true;
					this.isPostilDel = true;
				}

				let params = {
					"applnum": pageData.curApplnum,
					"userId": this.userId,
					"clntnum": data.clntnum,
					"chdrnum": data.chdrnum,
					"crtable": this.curPostilObj.crtable
				}
				showPostil(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						that.postilTempVO = res.data;
					} else {
						var lt_time = uwJs.showTime();
						var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12,
							14);
						that.postilTempVO['noteitem'] = "01";
						that.postilTempVO['applnum'] = data.applnum;
						that.postilTempVO['chdrnum'] = data.chdrnum;
						that.postilTempVO['clntnum'] = data.clntnum;
						that.postilTempVO['notecode'] = "";
						that.postilTempVO['crtuser'] = that.userId;
						that.postilTempVO['dtecrt'] = pageData.unipndPageList[0].lda_date;
						that.postilTempVO['crttime'] = ll_time1;
						that.postilTempVO['userProfile'] = that.userId;
						that.postilTempVO['jobName'] = uwconstant.jobName;
						that.postilTempVO['datime'] = this.initTime();
						that.postilTempVO['as_crtable'] = data.crtable;
						that.postilTempVO['ai_pcestrm'] = "0";
						that.postilTempVO['datasqnum'] = "";
						that.postilTempVO['flag'] = "N";
						that.postilTempVO['crtable'] = that.curPostilObj.crtable;
					}
					this.postilTempVO['surname'] = data.as_surname;
					this.postilTempVO['polpln'] = data.polpln;
				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})

				if (pageData.euaa.approval != "") {
					that.isRead = true;
				} else {
					if (!that.isApprovalDisabled && !pageData.allInfoReadOnly) {
						that.isRead = false;
					} else {
						that.isRead = true;
					}
				}
				that.initPostil(pageData, data);
				that.openPremium(pageData, data, "d", index)



				that.ppFlag = true;
			},

			ppSave() {
				let that = this;
				if (that.postilTempVO.notedesc == "") {
					that.popMsg("错误：除外原因未输入", 'error');
					that.subUnLoading = false;
					return false;
				} else {
					that.postilTempList.forEach(item => {
						if (item.pncode == 0) {
							that.popMsg("必要性栏位：批注代码必须输入", 'error');
							that.subUnLoading = false;
							return false;
						}
						if (item.pedesc == 0) {
							that.popMsg("必要性栏位：批注内容必须输入", 'error');
							that.subUnLoading = false;
							return false;
						}
					})
				}
				if ((this.premiumTempVO.notedesc == "" || this.premiumTempVO.notedesc == undefined) && length != 0) {
					this.popMsg("错误：加费作业主档未输入原因,加费明细不可存在", 'error');
					return false;
				}

				for (let i = 0; i < this.premiumTempList.length; i++) {
					let item = this.premiumTempList[i];
					if (item.opcda == null || item.opcda == "") {
						this.popMsg("必要性栏位：加费类别必须输入", 'error');
						return false;
					}
					let ld_oppc = Number(item.oppc);
					let ll_insprm = Number(item.insprm);
					let ll_zmortpct = Number(item.zmortpct);
					if (this.curAddPremObj.cnttype == "SUL") {
						if (ll_insprm == 0) {
							this.popMsg("必要性栏位：加费等级必须输入", 'error');
							return false;
						}
					} else if (ld_oppc == 0 && ll_insprm == 0 && ll_zmortpct == 0) {
						this.popMsg("必要性栏位：加费项目不可同时为零", 'error');
						return false;
					}
					this.curAddPremData.is_upd = "Y";
				}
				let flag1 = this.addPremSure(2);
				let flag2 = this.savePostil(2);

				if (this.premiumTempList && this.premiumTempList.length == 0 && this.postilTempList && this.postilTempList
					.length == 0) {
					this.curPostilObj.approval = "";
					//记录核保结论
					let euabs = [];
					this.curPostilData.trailer4.forEach(item => {
						if (this.curPostilObj.crtable == item.crtable) {
							console.log("记录核保结论:" + item.approval);
							item['oldapproval'] = item.approval;
						}
						euabs.push(item);
					})
					this.curPostilData.trailer4 = euabs;
					this.setData(this.curPostilData);

					this.changeApproval(this.curPostilData);
				}

				this.ppFlag = false;


			},
			/***************************加费除外 END**********************************************/

			/***************************核决 BEGIN**********************************************/
			checkSessionChange(pageData) {
				let that = this;
				let params = {
					"applnum": pageData.curApplnum,
					"curTime": pageData.curTime + "",
					"randomStr": this.randomStr,
					"lastUpdateTime": pageData.euaa.lastUpdateTime + "",
					"userId":that.userId
				}
				let res = uwLoadJs.checkSessionChange(params);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS) {

				} else {
					that.popMsg(res.resultMsg, 'error');
					return false;
				}

				return true;

			},

			// 险种核保结论样式
			conclusionsClass({
				row,
				rowIndex
			}) {
				row.index = rowIndex;
			},

			// 点击事件
			getConclusions(item, index) {
				console.log(index);
			},

			//加费除外
			validPremAndPotil(pageData, data) {
				let that = this;
				// if(!that.checkSessionChange(pageData)){
				//   that.subUnLoading = false;
				//   data.approval = "";
				//   return false;
				// }
				if (pageData.eufgpkyVO.raflag != "Y") {
					that.popMsg("当前用户没有加费权限！", 'error');
					that.subUnLoading = false;
					data.approval = data.oldapproval;
					return false;
				}
				if (pageData.eufgpkyVO.excflag != "Y") {
					that.popMsg("当前用户没有除外权限！", 'error');
					that.subUnLoading = false;
					data.approval = data.oldapproval;
					return false;
				}
				let pCrtable2 = data.crtable;
				let pCrtable1 = "";
				pageData.trailer4.forEach(item => {
					if (item.statFund == "M") {
						pCrtable1 = item.crtable;
					}
				})

				if (uwJs.judgeIsSpecCrtable('INSTPREM_SPLIT_R_CRTABLE', pCrtable2)) {
					that.popMsg("此险种不可以加费", 'error');
					that.subUnLoading = false;
					data.approval = data.oldapproval;
					return false;
				}

				let params1 = {
					"crtable1": pCrtable1,
					"crtable2": pCrtable2,
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/findNACountFromEufkpf';
				let res = uwLoadJs.ajaxRequest(params1, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS) {

				} else {
					that.popMsg(res.resultMsg, 'error');
					that.subUnLoading = false;
					data.approval = "";
					return false;
				}

				return true;
			},
			//险种核保结论
			changeConclusions(pageData, data) {
				let that = this;
				pageData.trailer4.forEach(item => {
					if (item.statFund == "M" && item.approval == '') {
						data.approval = data.oldapproval;
						that.popMsg("请先选择主险核保结论！！", 'error');
						return false;
					}
				})
				//pb\wp险判断
				if (data.approval == "D" || data.approval == "P") {
					for (const item of pageData.trailer4) {
						if (item.statFund != "M" && item.pbWpFlag == 'Y' && item.polpln != data.polpln && (item.approval !=
								'D' && item.approval != 'P')) {
							this.popMsg("本单含pb或wp险，需返回建档页面删除延期拒保的附加险！！", 'error');
							break;
						}
					}
				}
				//选择除外、加费除外以外的选项作判断，如含除外明细需提示删除
				if (data.approval != 'B' && data.approval != 'C') {
					that.initPostil(pageData, data); //先取得除外明细数据postilTempList
					let existPostil = false;
					for (let i = 0; i < this.postilTempList.length; i++) {

						if (data.crtable == this.postilTempList[i].pnfrom) {
							existPostil = true;
							break;
						}
					}
					if (existPostil) {
						data.approval = data.oldapproval;
						that.popMsg("结论更改，请先删除除外明细！！", 'error');
						return false;
					}
				}
				//S2021060818097上海银行手工单特殊系统作业规则 ---褚四锋 20210622 start
				if (pageData.shanghai && pageData.shanghai == '1' && (data.approval == 'A' || data.approval == 'B')) {
					data.approval = data.oldapproval;
					that.popMsg("上海银行保单不允许进行加费操作！", 'error');
					return false;
				}
				//S2021060818097上海银行手工单特殊系统作业规则 ---褚四锋 20210622 end
				if (data.approval == "W" || data.approval == "") {
					// if(pageData.euaa.approval=="W"){
					//   that.openResolve(pageData, data,1);
					//   return false;
					// }else{
					data.approval = data.oldapproval;
					return false;
					// }

				} else if (data.approval == "S") {
					if (this.isApprovalDisabled || pageData.allInfoReadOnly) {
						that.subUnLoading = false;
						data.approval = data.oldapproval;
						return false;
					}
					if (pageData.euaa.approval != "") {
						that.subUnLoading = false;
						data.approval = data.oldapproval;
						return false;
					}
				}

				this.subUnLoading = true;
				let ls_applnum = pageData.curApplnum;
				let params = {
					"applnum": ls_applnum
				}

				this.changeConclusionsTimeOut = setTimeout(function() {


					if (data.approval == "A") { //加费
						if (pageData.eufgpkyVO.raflag != "Y") {
							that.popMsg("当前用户没有加费权限！", 'error');
							that.subUnLoading = false;
							data.approval = data.oldapproval;
							return false;
						}
						let pCrtable2 = data.crtable;
						let pCrtable1 = "";
						pageData.trailer4.forEach(item => {
							if (item.statFund == "M") {
								pCrtable1 = item.crtable;
							}
						})

						if (uwJs.judgeIsSpecCrtable('INSTPREM_SPLIT_R_CRTABLE', pCrtable2)) {
							that.popMsg("此险种不可以加费", 'error');
							that.subUnLoading = false;
							data.approval = data.oldapproval;
							return false;
						}

						let params1 = {
							"crtable1": pCrtable1,
							"crtable2": pCrtable2,
						}
						let url = appName.NEWUNDR + '/unipnd/nucleusNote/findNACountFromEufkpf';
						let res = uwLoadJs.ajaxRequest(params1, url);
						if (res == null) {
							return false;
						}
						if (res.resultCode == constant.SUCCESS) {

						} else {
							that.popMsg(res.resultMsg, 'error');
							that.subUnLoading = false;
							data.approval = "";
							return false;
						}

						if (that.curPageData.isContainRate == '1') {
							that.$confirm("请确认费率档次是否选择正确，系统将按照最新费率档次计算保费！", '提示', {
								confirmButtonText: '确认',
								cancelButtonText: '取消',
								type: 'warning'
							}).then(() => {
								that.openPremium(pageData, data, "c", 1);
								//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
								pageData.isSameToOther = true;
								pageData.isSameToOtherPolicy = false;
							}).catch(() => {
								data.approval = data.oldapproval;
							});
						} else {
							that.openPremium(pageData, data, "c", 1);
							//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
							pageData.isSameToOther = true;
							pageData.isSameToOtherPolicy = false;
						}

					} else if (data.approval == "C") { //除外
						if (pageData.eufgpkyVO.excflag != "Y") {
							that.popMsg("当前用户没有除外权限！", 'error');
							that.subUnLoading = false;
							data.approval = data.oldapproval;
							return false;
						}


						that.openPostil(pageData, data);
						//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
						pageData.isSameToOther = true;
						pageData.isSameToOtherPolicy = false;


					} else if (data.approval == "D" || data.approval == "P" || data.approval == "W") { //延期、拒保、取消
						if (pageData.eufgpkyVO.canflag != "Y") {
							that.popMsg("讯息:您没有执行本作业之权限,请转呈授权主管", 'error');
							that.subUnLoading = false;
							data.approval = data.oldapproval;
							return false;
						}


						that.openResolve(pageData, data, 1);
						//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
						pageData.isSameToOther = true;
						pageData.isSameToOtherPolicy = false;
					} else if (data.approval == "S") {
						if (pageData.eufgpkyVO.uwflag != "Y") {
							that.popMsg("当前用户没有标准体权限！", 'error');
							that.subUnLoading = false;
							data.approval = data.oldapproval;
							return false;
						}
						// if(!that.checkSharein(pageData)){
						//   that.subUnLoading = false;
						//   data.approval = data.oldapproval;
						//   return false;
						// }
						// if(!that.checkIDCard(pageData)){
						//   that.subUnLoading = false;
						//   data.approval = data.oldapproval;
						//   return false;
						// }

						// 上一次核保结论为：除外、标准提，则重算保费
						if (data.oldapproval == "A" || data.oldapproval == "B") {
							that.clearPre(pageData, data);
						}

						data.oldapproval = data.approval;
						pageData.isSameToOther = false;
					} else if (data.approval == "B") { //加费除外
						let flag = that.validPremAndPotil(pageData, data);
						if (!flag) {
							return false;
						}
						if (that.curPageData.isContainRate == '1') {
							that.$confirm("请确认费率档次是否选择正确，系统将按照最新费率档次计算保费！", '提示', {
								confirmButtonText: '确认',
								cancelButtonText: '取消',
								type: 'warning'
							}).then(() => {
								that.openPPDioag(pageData, data, 1);
								//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
								pageData.isSameToOther = true;
								pageData.isSameToOtherPolicy = false;
							}).catch(() => {
								data.approval = data.oldapproval;
							});
						} else {
							that.openPPDioag(pageData, data, 1);
							//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
							pageData.isSameToOther = true;
							pageData.isSameToOtherPolicy = false;
						}
					}

					that.changePolicyConclusions(pageData);


					that.subUnLoading = false;
				}, 100);


			},

			clearPre(pageData, data) {
				let that = this;
				that.openPremium(pageData, data);
				if (that.premiumTempList && that.premiumTempList.length > 0) {
					that.premiumTempList = [];
					that.curAddPremData.is_calc == "Y"
					that.submitPremium();
					that.wfCalcPrem(pageData, "s", '', 'rate', that.flag03);

				}
			},

			//处理状态校验
			checkProcflg(pageData) {
				let that = this;
				let ls_applnum = pageData.curApplnum;
				let params = {
					"applnum": ls_applnum
				}
				let ls_procflg = ""
				// setTimeout(function()  {
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/findProcflgFromEuaapky';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					ls_procflg = res.data;
				}
				if (ls_procflg == "6") {
					that.popMsg("本单已结案，不能再进行操作 ！！！", 'error');
					return false;
				}
				return true;
				// }, 1000);

			},

			//检查再保
			checkSharein(pageData) {
				let that = this;
				let ls_applnum = pageData.curApplnum;
				let trailer4Count = pageData.trailer4 == null ? 0 : pageData.trailer4.length;
				// let gs_rimsg = "0";
				let ls_crtable = "";
				// setTimeout(function()  {
				for (let li_row = 0; li_row < trailer4Count; li_row++) {
					pageData.gs_rimsg = "0";
					ls_crtable = pageData.trailer4[li_row].crtable;
					if (that.wfCheckSharein(ls_crtable, 2, 2, pageData) == 0) {
						that.popMsg("再保提示：此受理单符合分保要求，请先输入有效的分保信息!", 'error');
						return false;
					} else {
						if (pageData.gs_rimsg == "0") {
							let ll_count = 0;
							let is_chdrnum = pageData.chdrnum;
							let params1 = {
								"chdrnum": is_chdrnum,
								"crtable": ls_crtable
							}
							let url = appName.NEWUNDR + '/unipnd/nucleusNote/countInseagnByChdrnumAndCrtable';
							let res = uwLoadJs.ajaxRequest(params1, url);
							if (res == null) {
								return false;
							}
							if (res.resultCode == constant.SUCCESS && res.data != null) {
								ll_count = res.data;
							}
							if (ll_count > 0) {
								that.popMsg("再保提示：此受理单险种" + ls_crtable + "不符合分保要求，但是存在有效的分保信息!", 'error');
								return false;
							}
						}
					}
				}

				//检测投保人信息与AS400数据是否差异
				let params2 = {
					"applnum": ls_applnum
				}
				let returnMessage = "";
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/checkCltdobCltsexClntnumFromEuadpkyByApplnum';
				let res = uwLoadJs.ajaxRequest(params2, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					returnMessage = res.data;
				}
				if (returnMessage != "") {
					that.popMsg(returnMessage, 'error');
					return false;
				}

				return true;
				// }, 1000);

			},

			//校验投保人/被保人/受益人身份证是否过期
			checkIDCard(pageData) {
				let that = this;
				let ls_applnum = pageData.curApplnum;

				// setTimeout(function()  {
				let params = {
					"applnum": ls_applnum
				}
				let flag1 = null;
				let message = null;
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/checkIDCard';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					flag1 = res.data.flag1;
					message = res.data.flag2;
				}

				if (flag1 != "0") { //验状态:0正常, 1异常
					that.popMsg(message, 'error');
					return false;
				}
				return true;
				// }, 1000);
			},

			//检查autopayin件
			checkAutopayin(pageData, approval) {
				let that = this;
				let ls_applnum = pageData.curApplnum;
				let li_cnt = 0;
				let li_cnt1 = 0;
				let as_final_uw = approval;

				// setTimeout(function()  {
				if (approval == "") {
					let countEuaapkyVO = null;
					let params1 = {
						"applnum": ls_applnum,
						"type": 1
					}
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/countEuaapkyByApplnumAndFlag10';
					let res = uwLoadJs.ajaxRequest(params1, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						countEuaapkyVO = res.data;
					}
					li_cnt = countEuaapkyVO.is_uw1on == null ? 0 : Number(countEuaapkyVO.is_uw1on);
					if (li_cnt > 0) {
						li_cnt1 = countEuaapkyVO.is_uw2on == null ? 0 : Number(countEuaapkyVO.is_uw2on);
						if (li_cnt1 == 1) {
							that.popMsg("警告信息：该单为autopayin件，且处于准备出盘状态，不可修改!!!", 'error');
							return false;
						}
					}
				}


				if (approval == "S" || approval == "A") {
					let countEuaapkyByApplnumAndFlag10VO = null;
					let params1 = {
						"applnum": ls_applnum,
						"type": 2
					}
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/countEuaapkyByApplnumAndFlag10';
					let res = uwLoadJs.ajaxRequest(params1, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						countEuaapkyByApplnumAndFlag10VO = res.data;
					}
					if (countEuaapkyByApplnumAndFlag10VO != null && countEuaapkyByApplnumAndFlag10VO != "") {
						li_cnt = countEuaapkyByApplnumAndFlag10VO.is_uw1on == null ? 0 : Number(
							countEuaapkyByApplnumAndFlag10VO.is_uw1on);
						if (li_cnt > 0) {
							li_cnt1 = countEuaapkyByApplnumAndFlag10VO.is_uw2on == null ? 0 : Number(
								countEuaapkyByApplnumAndFlag10VO.is_uw2on);
							if (li_cnt1 == 0) {
								//获取全民尊享组合单ABC标识
								let abcFlag = null;
								let url = appName.NEWUNDR + '/unipnd/nucleusNote/getPolSplitFlag';
								let res = uwLoadJs.ajaxRequest(params1, url);
								if (res == null) {
									return false;
								}
								if (res.resultCode == constant.SUCCESS && res.data != null) {
									abcFlag = res.data;
								}
								if (abcFlag = "") {
									that.popMsg("错误信息：该单为autopayin件，但无出盘记录，请重新试算!!!", 'error');
									return false;
								}
							} else {
								var row = countEuaapkyByApplnumAndFlag10VO.is_uw3on == null ? 0 : Number(
									countEuaapkyByApplnumAndFlag10VO.is_uw3on);
								if (row <= 0) {
									that.popMsg("错误信息：系统更新出盘标记失败，请手工检查!!!", 'error');
								}
								return false;
							}
						}
					}
				}

				return true;
				// }, 1000);
			},

			//改变整单核保结论
			changeApproval(pageData) {
				this.changePolicyConclusions(pageData);
				pageData.euaa.approval = "";
				pageData.euaa.procflg = "2";
				this.setData(pageData);
			},

			//整单核保结论选项初始化
			changePolicyConclusions(pageData) {

				this.changeAllConclusions(pageData);
				let ls_oldproc = pageData.oldProcflg;
				if (ls_oldproc == "4" || ls_oldproc == "5" || ls_oldproc == "1") {
					//若从处理状况为建档,核决或未入帐之状态下修改保单之核决结果
					//直接将处理状况改为核保
					// console.log("旧状态"+ls_oldproc+"直接将处理状况改为核保")
					// pageData.euaa.procflg = "2";
				}
				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == pageData.curApplnum) {
						datas.push(pageData);
					} else {
						datas.push(item);
					}
				})
				this.pageData = datas;
				console.log(this.pageData)
			},
			//初始化整单核保结论
			initPolicyConclusions(pageData) {
				this.changeAllConclusions(pageData);
			},
			changeAllConclusions(pageData) {
				let emptyCount = 0;
				let ACount = 0;
				let BCount = 0;
				let CCount = 0;
				let WCount = 0;
				let DCount = 0;
				let PCount = 0;
				let SCount = 0;
				let mainDflag = false;
				let mainPflag = false;
				let mainSflag = false;
				let pConclusions = [];

				pageData.trailer4.forEach(item => {
					if (item.approval.trim() == "") {
						emptyCount++;
					} else {
						if (item.approval.trim() == "A") { //加费
							ACount++;
						} else if (item.approval.trim() == "C") { //除外
							CCount++;
						} else if (item.approval.trim() == "D") { //延期
							DCount++;
						} else if (item.approval.trim() == "P") { //拒保
							PCount++;
						} else if (item.approval.trim() == "S") { //标准体
							SCount++;
						} else if (item.approval.trim() == "W") { //取消
							WCount++;
						} else if (item.approval.trim() == "B") { //加费除外
							BCount++;
						}
						if (item.statFund.trim() == 'M' && item.approval.trim() == "D") { //主险拒保
							mainDflag = true;
						} else if (item.statFund.trim() == 'M' && item.approval.trim() == "P") { //主险延期
							mainPflag = true;
						} else if (item.statFund.trim() == 'M' && item.approval.trim() == "S") { //主险延期
							mainSflag = true;
						}
					}
				})

				//所有险种核保决定为空时，整单核保结论可选“标准体”、“延期”、“拒保”、“撤销”，选择后自动更新险种核保决定
				if (emptyCount == pageData.trailer4.length) {
					pConclusions = [{
							label: "标准体",
							value: "S"
						},
						{
							label: "拒保",
							value: "D"
						},
						{
							label: "延期",
							value: "P"
						},
						{
							label: "取消",
							value: "W"
						},
						{
							label: "未核决",
							value: ""
						}
					]
				} else {
					//任一险种核保决定为空（其他任一险种非空），核保决定只可选择“撤销”
					// if (emptyCount > 0) {
					//   pConclusions = [
					//     {label: "取消", value: "W"},
					//     {label: "未核决", value: ""}
					//   ]
					// } else {
					if (mainSflag) {
						pConclusions = [{
								label: "标准体",
								value: "S"
							},
							{
								label: "取消",
								value: "W"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}
					//任一险种核保决定为“加费”、“除外”、“延期”、“拒保”时，整单核保决定只可选择“次标准体”或“撤销”，选择后不更新险种核保决定
					if (ACount > 0 || CCount > 0 || DCount > 0 || PCount > 0 || BCount > 0) {
						pConclusions = [{
								label: "次标准体",
								value: "A"
							},
							{
								label: "取消",
								value: "W"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}

					//所有险种核保决定为“标准体”，整单核保决定可选“标准体”、“撤销”
					if (SCount == pageData.trailer4.length) {
						pConclusions = [{
								label: "标准体",
								value: "S"
							},
							{
								label: "取消",
								value: "W"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}

					//所有险种核保决定为“加费”、“除外”，整单核保决定可选为“次标准体”、“撤销”
					if (ACount > 0 || CCount > 0 || BCount > 0 && DCount == 0 && SCount == 0 && PCount == 0) {
						pConclusions = [{
								label: "次标准体",
								value: "A"
							},
							{
								label: "取消",
								value: "W"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}

					//所有险种核保决定为“延期”，整单核保决定可选为“延期”
					if (PCount == pageData.trailer4.length) {
						pConclusions = [{
								label: "延期",
								value: "P"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}
					//所有险种核保决定为“拒保”，整单核保决定可选为“拒保”
					if (DCount == pageData.trailer4.length) {
						pConclusions = [{
								label: "拒保",
								value: "D"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}
					//取消
					if (WCount > 0) {
						pConclusions = [{
								label: "取消",
								value: "W"
							},
							{
								label: "未核决",
								value: ""
							}
						]
					}
				}
				//主险拒保
				if (mainDflag) {
					pConclusions = [{
							label: "拒保",
							value: "D"
						},
						{
							label: "未核决",
							value: ""
						}
					]
				}
				//主险延期
				if (mainPflag) {
					pConclusions = [{
							label: "延期",
							value: "P"
						},
						{
							label: "未核决",
							value: ""
						}
					]
				}

				// }

				// let count = 0;
				// pConclusions.forEach(item=>{
				//   if(pageData.euaa.approval !="" && item.value==pageData.euaa.approval){
				//     count++;
				//   }
				// })
				// if(count==0){
				//   pageData.euaa.approval ="";
				// }

				// pageData.euaa.approval = "";
				pageData['pConclusions'] = pConclusions;
				this.setData(pageData)
				console.log(this.pageData)
			},

			//核决权限校验
			conclusionShow(pageData) {
				let that = this;

				if (!that.inithjFlag) {
					that.pageData.forEach(ply => {
						that.getEufflvlvoListByUwlevel(ply);
						that.sublvlindNotY(ply);
						that.sublvlindInY(ply);
						that.inithjFlag = true;
					})
				}

				let is_uwlevel = pageData.is_uwlevel;
				let is_uwauth = pageData.is_uwauth;
				let msg = ""
				if (is_uwlevel == "N") {
					msg = this.wfUwLevel(pageData);
					if (msg == "") {
						is_uwauth = "Y";
					} else {
						is_uwauth = "N";
					}
					is_uwlevel = "Y";
				}

				if (is_uwauth == "N") {
					let message = "<p>" + msg + "</p>";
					message = message + "<p>核保额度超过授权,请转呈授权主管</p>";
					this.$message({
						dangerouslyUseHTMLString: true,
						message: message,
						type: "error"
					});
					this.isApprovalDisabled = true;
				} else {
					this.isApprovalDisabled = false;
				}
			},

			//整单核保结论为标准体 才可选本单核保结论适用于同时投保的其他保单
			changeSameToOther(pageData, approval, flag) {
				if (flag) {
					pageData.isSameToOther = true;
					pageData.isSameToOtherPolicy = false;
				} else {
					if (approval == "S" || approval == "P" || approval == "D") {
						pageData.isSameToOther = false;
					}
				}
			},
			//核决
			decideChanged(pageData) {
				//拦截试算了加费试算导致加费金额存在，致使核决回写时数据有误
				if (pageData.euaa.approval == "S") {
					let isAddPrem = false;
					pageData.trailer4.forEach(item => {
						if (item.zlinstprem > 0) {
							isAddPrem = true;
						}
					})
					if (isAddPrem) {
						this.popMsg("存在加费金额，险种核保结论不符，请重新选择险种核保结论！！", 'error');
						pageData.euaa.approval = '';
						return false;
					}
				}
				if (pageData.euaa.approval != "" && pageData.unipndPageList[0].ls_approval.trim() != "") {
					if (pageData.euaa.approval != pageData.unipndPageList[0].ls_approval.trim()) {
						pageData.euaa.approval = pageData.unipndPageList[0].ls_approval.trim();
						return false;
					} else {
						if (pageData.euaa.approval == "W") {
							let data = {};
							pageData.trailer4.forEach(item => {
								if (item.statFund == "M") {
									data = item;
								}
							})
							this.openResolve(pageData, data, 2);
							return false;
						}
					}
				}
				//pb\wp险判断
				let bpWpFlag = false;
				pageData.trailer4.forEach(item => {
					if (item.statFund != "M" && (item.approval == 'D' || item.approval == 'P')) {
						bpWpFlag = true;
					}
				})
				if (bpWpFlag) {
					for (const item of pageData.trailer4) {
						if (item.statFund != "M" && item.pbWpFlag == 'Y' && (item.approval != 'P' && item.approval !=
							'D')) {
							pageData.euaa.approval = '';
							this.popMsg("本单含pb或wp险，需返回建档页面删除延期拒保的附加险！！", 'error');
							return false;
						}
					}
				}

				console.log("开始核决：" + this.initTime())
				let that = this;
				//选择未核决，清除加费信息
				if (pageData.euaa.approval == "") {
					let euabs = [];
					let isEuabApplAorB = false;
					pageData.trailer4.forEach(euab => {
						//如果是加费或者加费除外，则需要把当前的pageData的的加费明细和除外明细清除，以及把加费金额置为0
						if (euab.zlinstprem > 0) {
							euab.zlinstprem = 0;
							that.premiumTempVO = [];
							isEuabApplAorB = true;
							//需要删除加费明细
							let params1 = {
								"applnum": euab.applnum,
								"chdrnum": euab.chdrnum,
								"clntnum": euab.clntnum,
								"remark02": that.userId,
							}
							let url2 = appName.NEWUNDR + '/unipnd/premium/deletePremiumTempWithCalc';
							let res2 = uwLoadJs.ajaxRequest(params1, url2);
						}
					})
					//不能单纯删掉加费，需要触发重算保费
					if (isEuabApplAorB) {
						that.wfCalcPrem(pageData, "", "", "rate");
					}
				}

				this.subUnLoading = true;
				this.pageModifyFlag = true;
				let ls_procflg = null;
				let ls_applnum = pageData.curApplnum;
				let params = {
					"applnum": ls_applnum
				}
				this.decideChangedTimeOut = setTimeout(function() {
					let param = {
						"applnum": ls_applnum
					}
					let ls_procflg = ""
					// setTimeout(function()  {
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/findProcflgFromEuaapky';
					let res = uwLoadJs.ajaxRequest(param, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						ls_procflg = res.data;
					}
					console.log("1核决-校验保单处理状态");
					if (ls_procflg == "6") {
						that.popMsg("本单已结案，不能再进行操作 ！！！", 'error');
						pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
						that.subUnLoading = false;
						return false;
					}


					let approval = pageData.euaa.approval;



					if (approval == "") {
						pageData.euaa.procflg = "2";
					}

					console.log("2核决-更新本单核保结论适用于同时投保的其他保单选项");
					//整单核保结论为标准体 延期 拒保 才可选本单核保结论适用于同时投保的其他保单
					if (approval == "S" || approval == "P" || approval == "D") {
						that.changeSameToOther(pageData, approval, false);
					} else {
						that.changeSameToOther(pageData, approval, true);
					}


					console.log("3核决-延期、拒保、取消 校验是否填写原因");
					//延期、拒保、取消 校验是否填写原因
					if (approval == "D" || approval == "P" || approval == "W") {
						// if (pageData.idwTrailer7List.length == 0) {
						let data = {};
						pageData.trailer4.forEach(item => {
							if (item.statFund == "M") {
								data = item;
							}
						})
						if (approval == "W") {
							that.changeSameToOther(pageData, approval, true);
						}
						// pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
						that.openResolve(pageData, data, 2);
						that.subUnLoading = false;
						return false;
						// }else{
						//   let notes = [];
						//   pageData.idwTrailer7List.forEach(item=>{
						//     if(approval == "D" ){//拒保
						//       if(item.noteType=="01"){
						//         notes.push(item);
						//       }
						//     }else if(approval == "P" ){//延期
						//       if(item.noteType=="02"){
						//         notes.push(item);
						//       }
						//     }else if(approval == "W"){//取消
						//       if(item.noteType=="03"){
						//         notes.push(item);
						//       }
						//     }
						//   })
						//       if(notes.length>0){
						//         that.addResolveEuba(pageData,approval,null,2);
						//       }else{
						//         let data = {};
						//         pageData.trailer4.forEach(item => {
						//           if (item.statFund == "M") {
						//             data = item;
						//           }
						//         })
						//         that.changeSameToOther(pageData,approval,true);
						//         that.openResolve(pageData, data,2);
						//         that.subUnLoading = false;
						//         return false;
						//       }
						// }
					}

					//检查再保
					if (approval == "S" || approval == "A") {

						if (!that.checkSharein(pageData)) {
							that.changeSameToOther(pageData, approval, true);
							pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
							that.subUnLoading = false;
							return false;
						}

					}
					console.log("4核决");
					let flag = that.decideItemchanged(pageData);
					console.log("===============================" + flag)
					if (!flag) {
						pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
						that.changeSameToOther(pageData, approval, true);
						that.subUnLoading = false;
						return false;
					}

					let as_final_uw = approval;

					if (approval == "") {
						if (!that.checkAutopayin(pageData, approval)) {
							return false;
						}
					}


					if (as_final_uw == "S" || as_final_uw == "A") {
						if (!that.checkAutopayin(pageData, approval)) {
							that.changeSameToOther(pageData, approval, true);
							pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
							that.subUnLoading = false;
							return false;
						}
					}

					console.log("5核决-更新首次核保日期");
					if (ls_procflg == "4") {
						if (as_final_uw == "S" || as_final_uw == "A") {
							let params3 = {
								"applnum": ls_applnum,
								"lda_date": pageData.unipndPageList[0].lda_date,
								"userid": pageData.unipndPageList[0].userId,
							}
							let li_return = 0;
							let url = appName.NEWUNDR + '/unipnd/nucleusUpdate/updSort';
							let res = uwLoadJs.ajaxRequest(params3, url);
							if (res == null) {
								return false;
							}
							if (res.resultCode == constant.SUCCESS && res.data != null) {
								li_return = res.data;
							}
							if (li_return == -1) {
								that.popMsg("更新首次核保日期失败,请咨询系统人员!", 'error');
							} else if (li_return == 2) {
								that.popMsg("scf1中无资料，无法更新首次核保日期!", 'error');
							} else if (li_return == 1) {
								let params3 = {
									"applnum": ls_applnum
								}
								let res = uwLoadJs.findEuaapkyByApplnum(params3);
								if (res == null) {
									return false;
								}
								if (res.resultCode == constant.SUCCESS && res.data != null) {
									let ll_appldate1 = Number(res.data.firstApplDate);
									let ls_appluser = res.data.firstApplUser;

									if (pageData.euaa.firstApplDate == "0" || pageData.euaa.firstApplDate == "") {
										// pageData.euaa.appldate = ll_appldate1; //首次核保日期
										pageData.euaa.firstApplDate = ll_appldate1; //首次核保日期
									}
									if (pageData.euaa.firstApplUser == "0" || pageData.euaa.firstApplUser == "") {
										pageData.euaa.appluser = ls_appluser; //首次核保人员
										pageData.euaa.firstApplUser = ls_appluser; //首次核保人员
									}
								}
							}
						}
					}

					that.decideAfter(pageData);
				}, 100);
			},
			decideAfter(pageData) {
				let that = this;
				let approval = pageData.euaa.approval;

				if (approval != "") {
					let count = 0;
					pageData.trailer4.forEach(item => {
						if (item.approval == "") {
							count++;
						}
					})
					if (count == pageData.trailer4.length) {
						pageData.trailer4.forEach(item => {
							item.approval = approval;
							item['oldapproval'] = approval;
						})
					}
					//整单结论为延期拒保取消，设置险种结论
					if (approval == "W" || approval == "P" || approval == "D") {
						pageData.trailer4.forEach(item => {
							item.approval = approval;
							item['oldapproval'] = approval;
						})
					}

					if (pageData.unipndPageList[0].is_uw2on == "Y" && pageData.unipndPageList[0].is_uw3on == "Y") {
						that.wfObjectEnable(pageData, false);
					}
					pageData.unipndPageList[0].is_uw1on = "Y";
					pageData.unipndPageList[0].ls_approval = approval; //重新赋值
					that.isRead = true;
				} else {
					let euads = [];
					pageData.trailer4.forEach(euab => {
						euab.approval = "";
						euab['oldapproval'] = "";
						euads.push(euab);
					});
					pageData.trailer4 = euads;

					pageData.unipndPageList[0].is_uw1on = "N";
					that.wfObjectEnable(pageData, true);
					that.changePolicyConclusions(pageData);
					if (that.isTBSX) {
						pageData['allInfoReadOnly'] = false;
					}
					that.isRead = false;
				}
				console.log("6核决-更新照会事项不可输入控制");
				that.blockIdwTrailer();
				that.subUnLoading = false;

				console.log("完成核决：" + that.initTime())
				console.log(pageData)
			},

			decideItemchanged(pageData) {
				let that = this;
				let ls_applnum = pageData.curApplnum;
				let approval = pageData.euaa.approval;
				//核准不得为Y
				if (pageData.appind == "Y") {
					this.popMsg("讯息：执行保单核决,照会核准栏位不可为Y", 'error');
					pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
					return false;
				}

				//核决代码输入及授权检核
				if (this.ofEditCheck(pageData) == -1) {
					pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
					return false;
				}

				//若核保决定为未核决 => 检查处理状况是否已做修改
				let flag = false;
				while (flag == false) {
					if (pageData.euaa.approval == "") {
						let ls_oldproc = pageData.oldProcflg;
						if (ls_oldproc == "4" || ls_oldproc == "5" || ls_oldproc == "1") {
							//若从处理状况为建档,核决或未入帐之状态下修改保单之核决结果
							//直接将处理状况改为核保
							console.log("旧状态" + ls_oldproc + "直接将处理状况改为核保")
							pageData.euaa.procflg = "2";
						}
						//将核决日期及人员改为0
						if (pageData.euaa.dateup04 != "0" && pageData.euaa.dateup04 != "99999999") {
							pageData.euaa.dateup04 = "0";
						}
						break;
					}

					//照会代码须已处理完成
					if (this.ofPendingCheck(pageData) == -1) {
						this.popMsg("讯息：照会事项未处理完成,不可执行保单核决", 'error');
						pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
						return false;
					}
					break;
				}

				// 当选项为标准体或次标准体时,校验投保人/被保人/受益人身份证是否过期
				if (approval == "S" || approval == "A") {
					if (!this.checkIDCard(pageData)) {
						pageData.euaa.approval = pageData.unipndPageList[0].ls_approval;
						return false;
					}
				}

				let ld_instprem = 0;
				if ((approval == "D" || approval == "P") &&
					(pageData.unipndPageList[0].ls_approval == "S" || pageData.unipndPageList[0].ls_approval == "A" ||
						pageData.unipndPageList[0].ls_approval == "")) {

					let li_row = pageData.trailer4 == null ? 0 : pageData.trailer4.length;
					for (let li_cnt = 0; li_cnt < li_row; li_cnt++) {
						ld_instprem = Number(ld_instprem) + Number(pageData.trailer4[li_cnt].firstprem);
					}
					ld_instprem = Number(pageData.euaa.old_instprem) - Number(ld_instprem);
					pageData.euaa.as_instprem = Number(ld_instprem).toFixed(2)
				} else {
					if ((approval == "" || approval == "S" || approval == "A") &&
						(pageData.unipndPageList[0].ls_approval == "D" || pageData.unipndPageList[0].ls_approval == "P")) {
						let li_row = pageData.trailer4 == null ? 0 : pageData.trailer4.length;
						for (let li_cnt = 0; li_cnt < li_row; li_cnt++) {
							ld_instprem = Number(ld_instprem) + Number(pageData.trailer4[li_cnt].firstprem);
						}
						ld_instprem = Number(pageData.euaa.old_instprem) - Number(ld_instprem);
						pageData.euaa.as_instprem = Number(ld_instprem).toFixed(2)
					}
				}


				//设定主约之核决日期及人员
				pageData.trailer4.forEach(item => {
					if (item.statFund == "M") {
						item.polappusr = pageData.unipndPageList[0].userId;
						item.aprvdate = pageData.unipndPageList[0].lda_date;
						// item.approval = approval;
					}
				})

				//若所有保单均已作核决,修改受理主档之核决日期
				let ll_appldate = 0;
				let ls_cnttype = "";
				let ls_clntnum = "";
				if (approval != "") {
					ll_appldate = Number(pageData.euaa.as_appldate);
					if (pageData.trailer4 != null) {
						pageData.trailer4.forEach(item => {
							if (item.statFund == "M") {
								ls_cnttype = item.cnttype;
								ls_clntnum = item.clntnum;
							}
						})
					}
					if (ls_cnttype == "VSB" || ls_cnttype == "2VS") {
						pageData.euaa.dateup04 = ll_appldate;
					} else {
						pageData.euaa.dateup04 = pageData.unipndPageList[0].lda_date
					}

					//修改受理主档之处理状况
					//若任一险种之核决为标准体或次标准体 => 检查缴费状况
					if (approval == "S" || approval == "A") {
						if (Number(pageData.euaa.as_instprem) - Number(pageData.euaa.as_payment) > 2000) {
							pageData.euaa.procflg = "4"; //核决
						}
					}

					pageData.euaa.procflg = "4"; //核决
					pageData.euaa.appluser = pageData.unipndPageList[0].userId; //核决人员

					let ajaxvoLl_cltdob8Flag1 = null;
					let ajaxvoIdwHeaderCaldateFlag2 = null;
					let ajaxvoRCDDateFlag3 = null;
					let ajaxvoIdwHeaderNextbdateFlag4 = null;
					let params2 = {
						"clntnum": ls_clntnum,
						"ll_caldate": pageData.euaa.caldate,
						"ls_billfreq": pageData.euaa.billfreq,
						"unipndPageList_lda_date": pageData.unipndPageList[0].lda_date,
						"ls_cnttype": ls_cnttype,
						"applnum": ls_applnum,
						"ll_appldate": ll_appldate
					}
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/decideItemchangedIdwHeaderCaldateNextbDate';
					let res = uwLoadJs.ajaxRequest(params2, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						ajaxvoLl_cltdob8Flag1 = res.data.flag1;
						ajaxvoIdwHeaderCaldateFlag2 = res.data.flag2;
						ajaxvoRCDDateFlag3 = res.data.flag3;
						ajaxvoIdwHeaderNextbdateFlag4 = res.data.flag4;
					}

					if (ajaxvoLl_cltdob8Flag1 != null && ajaxvoLl_cltdob8Flag1 != "") {
						if (ajaxvoIdwHeaderCaldateFlag2 != null && ajaxvoIdwHeaderCaldateFlag2 != "" && pageData.euaa
							.riskType != '续保' && pageData.euaa.riskType != '转投保') {
							pageData.euaa.caldate = pageData.unipndPageList[0].lda_date;
						}
					} else {
						this.popMsg("错误：计算RCD日期时读取资料错误", 'error');
						return false;
					}
					if (pageData.euaa.riskType != '续保' && pageData.euaa.riskType != '转投保') {
						pageData.euaa.nextbdate = ajaxvoIdwHeaderNextbdateFlag4;
					}

				}

				pageData.unipndPageList[0].ls_approval = approval;
				return true;
			},
			ofEditCheck(pageData) {
				let approval = pageData.euaa.approval;
				//核保权限检核
				if (approval == "S") { //标准体
					if (pageData.eufgpkyVO.uwflag == "Y") {
						return 1;
					}
				} else if (approval == "A") { //次标准体
					if (pageData.eufgpkyVO.raflag == "Y") {
						return 1;
					}
				} else if (approval == "D" || approval == "P" || approval == "W") { //拒保,延期,取消
					if (pageData.eufgpkyVO.canflag == "Y") {
						return 1;
					}
				} else { //未核决
					return 1;
				}

				this.popMsg("讯息：超过作业授权,请转呈授权主管", 'error');
				return -1;
			},
			ofPendingCheck(pageData) {
				let approval = pageData.euaa.approval;
				//除取消件外,照会事项代码(除批注类)须已处理完成
				if (approval == "W" || approval == "D" || approval == "P") {
					return 1;
				}

				for (let i = 0; i < pageData.eubas.length; i++) {
					let euba = pageData.eubas[i];
					if (euba.procflg == "" && euba.zresnpd != "04") {
						//未处理,须检查forceind and resolve栏位,若为空白仍可核决
						if (euba.forceind != "" || euba.resind != "") {
							return -1;
						}
					}
				}

				return 1;
			},
			//核保等级读取
			async getEufflvlvoListByUwlevel(pageData) {
				let dw_uwlevel = null;
				let params1 = {
					"uwlevel": pageData.unipndPageList[0].is_Uwlevel
				}
				// let url = appName.NEWUNDR + '/unipnd/nucleusNote/getEufflvlvoListByUwlevel';
				// let res = uwLoadJs.ajaxRequest(params1,url);
				// if(res==null){
				//   return false;
				// }
				await getEufflvlvoListByUwlevel(params1).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						dw_uwlevel = res.data;
					}
				})

				pageData.dw_uwlevel = dw_uwlevel;
				this.setData(pageData);

				this.getCrtableList(pageData, dw_uwlevel);
			},

			getCrtableList(pageData, dw_uwlevel) {
				let ls_curren_type_str = [];
				let crtableListArray = new Array();
				let li_row = dw_uwlevel == null ? 0 : dw_uwlevel.length;
				for (let dw_uwlevel_i = 0; dw_uwlevel_i < li_row; dw_uwlevel_i++) {
					let ls_curren_type1 = dw_uwlevel[dw_uwlevel_i].uwtype;
					if (ls_curren_type1.trim() == "0") {

					} else {
						if (ls_curren_type1.length == 1) {
							ls_curren_type_str.push("0" + ls_curren_type1);
						} else {
							ls_curren_type_str.push(ls_curren_type1);
						}
					}
				}
				let crtableList = null;
				if (ls_curren_type_str.length > 0) {

					let params3 = {
						"dw_uwlevel": JSON.stringify(ls_curren_type_str)
					}
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/fGetTotallist';
					let res = uwLoadJs.ajaxRequest(params3, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						crtableList = res.data;
					}
					if (crtableList != null) {
						for (var i = 0; i < crtableList.length; i++) {
							crtableListArray[crtableList[i].acctype] = crtableList[i].crtable;
						}
					}
				}
				pageData.crtableListArray = crtableListArray;
				this.setData(pageData);
			},

			//不使用二级授权 判断是否超额
			async sublvlindNotY(pageData) {
				let dw_uwlevel = pageData.dw_uwlevel;
				let crtableListArray = pageData.crtableListArray;
				let dw_eu001 = pageData.dw_eu001;
				let ids_eula = pageData.ids_eula;
				let ld_sumins = 0;

				let li_row = dw_uwlevel == null ? 0 : dw_uwlevel.length;
				for (let li_i = 0; li_i < li_row; li_i++) {
					let ls_curren_type = "";
					let dw = dw_uwlevel[li_i];
					let ld_max_sumins = Number(dw.gramt) * 10000;
					ls_curren_type = dw.uwtype;
					console.log(dw.uwtype + ":" + ls_curren_type)
					let ls_sublvlind = dw.flag01;
					let ls_unitind = dw.flag02;
					let ls_currtypeold = ls_curren_type;
					if (ls_curren_type == "0") {

					} else {
						//不使用二级授权（EUFFPF.FLAG01<>'Y'）
						if (ls_sublvlind != "Y") {
							console.log("不使用二级授权ls_sublvlind != Y")
							if (ls_curren_type.length == 1) {
								ls_curren_type = "0" + ls_curren_type;
							}

							let ls_acctotallist = [];
							if (crtableListArray[ls_curren_type] != null || crtableListArray[ls_curren_type] !=
								undefined) {
								crtableListArray[ls_curren_type].toString().split(",").forEach(item => {
									ls_acctotallist.push(item);
								})
							}
							let is_lifeauth = [];
							if (pageData.unipndPageList[0].is_lifeauths.indexOf(",") != -1) {
								is_lifeauth = pageData.unipndPageList[0].is_lifeauths.split(",");
							} else {
								is_lifeauth.push(pageData.unipndPageList[0].is_lifeauths)
							}

							let li_upperbound = is_lifeauth.length;

							let index = 0;
							for (var i = 0; i < li_upperbound; i++) {
								let dwEu001 = new Array();
								if (dw_eu001 != null) {
									if (ls_acctotallist.length > 0) {
										let clntnum = is_lifeauth[i];
										for (var j = 0; j < dw_eu001.length; j++) {
											if (dw_eu001[j].clntnum == clntnum && (dw_eu001[j].statcode == "IF" ||
													dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode == "UW" ||
													dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode == "PH")) {
												for (var x = 0; x < ls_acctotallist.length; x++) {
													if (dw_eu001[j].crtable == ls_acctotallist[x]) {
														dwEu001[index] = dw_eu001[j];
														index++;
														break;
													}
												}
											}
										}
									} else {
										for (var j = 0; j < dw_eu001.length; j++) {
											if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode ==
													"IF" || dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode ==
													"UW" || dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode ==
													"PH")) {
												dwEu001[index] = dw_eu001[j];
												index++;
											}
										}
									}
								}

								let li_roww = dwEu001.length;
								let ld_total_sumins = 0;
								for (var j = 0; j < li_roww; j++) {
									let sumins = dwEu001[j].sumins;
									let sumins_org = dwEu001[j].suminsOrg;
									let cedprm = dwEu001[j].cedprm;
									let statcode = dwEu001[j].statcode;
									let instprem = dwEu001[j].instprem;
									let premCessTerm = dwEu001[j].premCessTerm;
									let billfreq = dwEu001[j].fupdesc;
									let acctype = dwEu001[j].acctype;
									let crtable = dwEu001[j].crtable;
									let chdrnum = dwEu001[j].chdrnum;
									let crrcd = dwEu001[j].crrcd; //保单生效日
									let reinsdate = dwEu001[j].reinsdate; //保单复效日
									let idsEula = new Array();
									if (ids_eula != null) {
										for (var x = 0; x < ids_eula.length; x++) {
											if (ids_eula[x].crtable == crtable && ids_eula[x].acctype ==
												ls_curren_type) {
												idsEula[0] = ids_eula[x];
												break;
											}
										}
									}
									if (idsEula.length > 0) {
										let percent01 = idsEula[0].percent01;
										let percent02 = idsEula[0].percent02;
										let flag02 = idsEula[0].flag02;
										acctype = idsEula[0].acctype;

										let params4 = {
											"crtable": crtable,
											"sumins": sumins,
											"sumins_org": sumins_org,
											"chdrnum": chdrnum,
											"statcode": statcode,
											"premCessTerm": premCessTerm,
											"billfreq": billfreq,
											"instprem": instprem,
											"cedprm": cedprm,
											"crrcd": crrcd,
											"reinsdate": reinsdate,
											"acctype": acctype,
											"flag02": flag02,
											"percent01": percent01,
											"percent02": percent02
										}
										await calRiskSuminsForJsp(params4).then(res => {
											if (res.resultCode == constant.SUCCESS && res.data != null) {
												ld_sumins = res.data;
											}
										}).catch(err => {

										})
									}
									ld_total_sumins = Number(ld_total_sumins) + Number(ld_sumins);
								}
								if (ld_total_sumins > ld_max_sumins) {
									let msg = "错误 new:Account TYPE" + ls_curren_type + "超过限额:" + Number(
										ld_total_sumins).toFixed(2) + "/" + Number(ld_max_sumins).toFixed(2);
									dw_uwlevel[li_i]['errorMsg'] = msg;
								}
							}
						}
					}
				}

				pageData.dw_uwlevel = dw_uwlevel;
				this.setData(pageData);
			},

			//使用二级授权
			async sublvlindInY(pageData) {
				let is_chdrnum = pageData.chdrnum;
				let dw_uwlevel = pageData.dw_uwlevel;
				let crtableListArray = pageData.crtableListArray;
				let dw_eu001 = pageData.dw_eu001;
				let ids_eula = pageData.ids_eula;
				let ld_sumins = 0;

				let li_row = dw_uwlevel == null ? 0 : dw_uwlevel.length;
				for (let li_i = 0; li_i < li_row; li_i++) {
					let ls_curren_type = "";
					let dw = dw_uwlevel[li_i];
					let ld_max_sumins = Number(dw.gramt) * 10000;
					ls_curren_type = dw.uwtype;
					console.log(dw.uwtype + ":" + ls_curren_type)
					let ls_sublvlind = dw.flag01;
					let ls_unitind = dw.flag02;
					let ls_currtypeold = ls_curren_type;
					if (ls_curren_type == "0") {

					} else {
						if (ls_sublvlind == "Y") {
							console.log("使用二级授权")
							if (ls_curren_type.length == 1) {
								ls_curren_type = "0" + ls_curren_type;
							}
							let ls_acctotallist = [];
							if (crtableListArray[ls_curren_type] != null || crtableListArray[ls_curren_type] !=
								undefined) {
								crtableListArray[ls_curren_type].toString().split(",").forEach(item => {
									ls_acctotallist.push(item);
								})
							}

							let is_lifeauth = [];
							if (pageData.unipndPageList[0].is_lifeauths.indexOf(",") != -1) {
								is_lifeauth = pageData.unipndPageList[0].is_lifeauths.split(",");
							} else {
								is_lifeauth.push(pageData.unipndPageList[0].is_lifeauths)
							}
							let li_upperbound = is_lifeauth.length;
							let index = 0;
							//循环客户号（is_lifeauth:客户号列表）
							for (var i = 0; i < li_upperbound; i++) {
								let li_rowthiscase = 0;
								let dwEu001 = new Array();

								//所有保单列表
								if (dw_eu001 != null) {
									if (ls_acctotallist.length > 0) {

										//循环所有保单列表，把当前保单的符合累计规则的险种抽取出来
										for (var j = 0; j < dw_eu001.length; j++) { //循环所有保单列表

											if (is_chdrnum == dw_eu001[j].chdrnum && dw_eu001[j].clntnum ==
												is_lifeauth[i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j]
													.statcode == "PS" || dw_eu001[j].statcode == "UW" || dw_eu001[j]
													.statcode == "MP" || dw_eu001[j].statcode == "PH")) {
												for (var x = 0; x < ls_acctotallist.length; x++) {
													if (dw_eu001[j].crtable == ls_acctotallist[x]) {
														dwEu001[index] = dw_eu001[j]; //提取当前保单和客户号对应的险种
														index++;
														break;
													}
												}
											}
										}
									} else {
										for (var j = 0; j < dw_eu001.length; j++) {
											if (is_chdrnum == dw_eu001[j].chdrnum && dw_eu001[j].clntnum ==
												is_lifeauth[i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j]
													.statcode == "PS" || dw_eu001[j].statcode == "UW" || dw_eu001[j]
													.statcode == "MP" || dw_eu001[j].statcode == "PH")) {
												dwEu001[index] = dw_eu001[j];
												index++;
											}
										}
									}
								}

								let index1 = 0;
								li_rowthiscase = dwEu001.length;
								if (li_rowthiscase > 0) {
									let dwEu001 = new Array();
									if (dw_eu001 != null) {
										if (ls_acctotallist.length > 0) {
											for (var j = 0; j < dw_eu001.length; j++) { //循环所有历史保单
												if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode ==
														"IF" || dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode ==
														"UW" || dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode ==
														"PH")) {
													for (var x = 0; x < ls_acctotallist.length; x++) {
														if (dw_eu001[j].crtable == ls_acctotallist[x]) {
															dwEu001[index1] = dw_eu001[j];
															index1++;
															break;
														}
													}
												}
											}
										} else {
											for (var j = 0; j < dw_eu001.length; j++) {
												if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode ==
														"IF" || dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode ==
														"UW" || dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode ==
														"PH")) {
													dwEu001[index1] = dw_eu001[j];
													index1++;
												}
											}
										}
									}
									let li_roww = dwEu001.length;
									if (li_roww > 0) {
										let ld_total_sumins = 0;
										let list;

										let param = {
											"clntnum": is_lifeauth[i]
										}
										await initAmount(param).then(res => {
											if (res.resultCode == constant.SUCCESS && res.data != null && res
												.data.list) {
												list = res.data.list;
											}
										})
										for (var kk = 0; kk < li_roww; kk++) {
											let ld_sumins = 0;
											let dw001 = dwEu001[kk];
											let crtable = dw001.crtable;
											let chdrnum = dw001.chdrnum;
											if (list) {
												list.forEach(map => {
													if (Number(map.total) > 0) {
														map.crtLists.forEach(cr => {
															//匹配到该险种出现在这个累计值中，再根据当前的uwtype来判断取哪一种累加值
															if (chdrnum == cr.chdrnum && crtable == cr
																.crtable) {
																for (var a in uwconstant.amountMatch) {
																	let item = uwconstant.amountMatch[
																		a];
																	if (map.name == item.name &&
																		ls_curren_type == item.uwtype
																		) {
																		ld_sumins = Number(ld_sumins) +
																			Number(cr.count);
																	}
																}
															}
														})
													}
												})
											}
											ld_total_sumins = Number(ld_total_sumins) + Number(ld_sumins);

										}
										console.log("使用二级授权 :查询客户号：" + is_lifeauth[i] + " 获取累计保额" + ls_curren_type +
											" 的值:ld_total_sumins:" + ld_total_sumins)
										if (ls_unitind != "Y") {
											ld_total_sumins = Number(ld_total_sumins) / 10000;
										}
										let acctotallist = [];
										if (crtableListArray[ls_curren_type] != null || crtableListArray[
												ls_curren_type] != undefined) {
											crtableListArray[ls_curren_type].toString().split(",").forEach(item => {
												acctotallist.push(item);
											})
										}
										acctotallist = await this.fGetTotallistpol(acctotallist, pageData.euaa
										.applnum);
										dw_uwlevel[li_i]['ld_total_sumins'] = ld_total_sumins;
										dw_uwlevel[li_i]['acctotallist'] = acctotallist;
									}
								}

							}
						}
					}
				}

				pageData.dw_uwlevel = dw_uwlevel;
				this.setData(pageData);
				this.inithjFlag = true;
			},

			//根据核保等级判断是否超额
			wfUwLevel(pageData) {
				let that = this;
				let is_chdrnum = pageData.chdrnum;
				let is_uwflag = pageData.is_uwflag;
				let dw_uwlevel = null;
				let premium = new Array();
				let ll_maxemtmp = 0,
					ll_maxem = 0,
					ll_maxoppc = 0;
				//核保等级读取
				if (is_uwflag == null || is_uwflag != "Y") {
					// let params1 = {
					//   "uwlevel": pageData.unipndPageList[0].is_Uwlevel
					// }
					// let url = appName.NEWUNDR + '/unipnd/nucleusNote/getEufflvlvoListByUwlevel';
					// let res = uwLoadJs.ajaxRequest(params1,url);
					// if(res==null){
					//   return false;
					// }
					// if (res.resultCode == constant.SUCCESS && res.data != null) {
					//   dw_uwlevel = res.data;
					// }
					dw_uwlevel = pageData.dw_uwlevel;
					is_uwflag = "Y";
				}

				//如查PVY保单，则必须要核保等级>=9级人员进行核保 add by Edwin 20090605
				let ll_count = pageData.initPageDateList[0].countScf4pkyByApplnum == null ? 0 : pageData.initPageDateList[
					0].countScf4pkyByApplnum;
				if (ll_count > 0) {
					let ls_ind32 = pageData.initPageDateList[0].findInd32FromScf4pky == null ? 0 : pageData
						.initPageDateList[0].findInd32FromScf4pky;
					if (ls_ind32 == "1") {
						if (unipndPageList[0].is_Uwlevel < "6") {
							this.popMsg("只有核保授权等级为5级及5级以上的核保人员才能处理私人银行照会", 'error');
							return -1;
						}
					}
				}

				//判断保单的照会类型
				let ls_string = "";
				pageData.eubas.forEach(euba => {
					if (ls_string == "") {
						ls_string = euba.pncode.toString() + ",";
					} else {
						ls_string = ls_string + euba.pncode.toString() + ",";
					}
				})
				if (ls_string.indexOf(",") != -1) {
					ls_string = ls_string.substring(0, ls_string.length - 1);
				}

				let li_count1 = 0;
				let params2 = {
					"pncode": ls_string
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/countEuhcByPncodeAndFlag01';
				let res = uwLoadJs.ajaxRequest(params2, url);
				if (res == null) {

				} else if (res.resultCode == constant.SUCCESS && res.data != null) {
					li_count1 = res.data;
				}

				let ls_flag1 = "";
				if (li_count1 == 0) {
					ls_flag1 = "A";
				} else {
					ls_flag1 = "B";
				}
				if (ls_string.length > 0 && ls_flag1 == "A") {
					return 0;
				}

				let li_row = dw_uwlevel == null ? 0 : dw_uwlevel.length;

				//*******************fGetTotallist start*************************
				// let ls_curren_type_str = [];
				let crtableListArray = new Array();
				crtableListArray = pageData.crtableListArray;
				// for (let dw_uwlevel_i = 0; dw_uwlevel_i < li_row; dw_uwlevel_i++) {
				//   let ls_curren_type1 = dw_uwlevel[dw_uwlevel_i].uwtype;
				//   if (ls_curren_type1.trim() == "0") {
				//
				//   } else {
				//     if (ls_curren_type1.length == 1) {
				//       ls_curren_type_str.push("0" + ls_curren_type1);
				//     } else {
				//       ls_curren_type_str.push(ls_curren_type1);
				//     }
				//   }
				// }
				// let crtableList = null;
				// if (ls_curren_type_str.length > 0) {
				//
				//   let params3 = {
				//     "dw_uwlevel": JSON.stringify(ls_curren_type_str)
				//   }
				//   let url = appName.NEWUNDR + '/unipnd/nucleusNote/fGetTotallist';
				//   let res = uwLoadJs.ajaxRequest(params3,url);
				//   if(res==null){
				//     return false;
				//   }
				//   if (res.resultCode == constant.SUCCESS && res.data != null) {
				//     crtableList = res.data;
				//   }
				//   if (crtableList != null) {
				//     for (var i = 0; i < crtableList.length; i++) {
				//       crtableListArray[crtableList[i].acctype] = crtableList[i].crtable;
				//     }
				//   }
				// }
				//*******************fGetTotallist end*************************

				let dw_eu001 = pageData.dw_eu001;
				let ids_eula = pageData.ids_eula;
				let ld_sumins = 0;

				let premiumList = null;
				let params5 = {
					"applnum": pageData.euaa.applnum,
					"userId": this.userId
				}
				let url5 = appName.NEWUNDR + '/unipnd/nucleusNote/findEutdpfAll';
				let res5 = uwLoadJs.ajaxRequest(params5, url5);
				if (res5 == null) {

				} else if (res5.resultCode == constant.SUCCESS && res5.data != null) {
					premiumList = res5.data;
				}

				for (let li_i = 0; li_i < li_row; li_i++) {
					let ls_curren_type = "";
					let dw = dw_uwlevel[li_i];
					let ld_max_sumins = Number(dw.gramt) * 10000;
					ls_curren_type = dw.uwtype;
					console.log(dw.uwtype + ":" + ls_curren_type)
					let ls_sublvlind = dw.flag01;
					let ls_unitind = dw.flag02;
					let ls_currtypeold = ls_curren_type;

					if (ls_curren_type == "0") {
						console.log("ls_curren_type=0")
						let ld_topup = 0;
						ld_topup = pageData.initPageDateList[0].findSumOrigamtFromZtopByApplnum;
						if (ld_topup > ld_max_sumins) {
							let msg = "Topup超过限额:" + Number(ld_topup).toFixed(2) + "/" + Number(ld_max_sumins).toFixed(2);
							return msg;
						}
					} else {
						if (ls_sublvlind != "Y") { //不使用二级授权（EUFFPF.FLAG01<>'Y'）
							console.log("不使用二级授权ls_sublvlind != Y")
							if (dw.errorMsg) {
								return dw.errorMsg;
							}
						} else { //使用二级授权（EUFFPF.FLAG01='Y'）
							console.log("使用二级授权")
							if (ls_curren_type.length == 1) {
								ls_curren_type = "0" + ls_curren_type;
							}

							// let acctotallist = crtableListArray[ls_curren_type].toString();
							let ls_acctotallist = [];
							if (crtableListArray[ls_curren_type] != null || crtableListArray[ls_curren_type] !=
								undefined) {
								crtableListArray[ls_curren_type].toString().split(",").forEach(item => {
									ls_acctotallist.push(item);
								})
							}

							let is_lifeauth = [];
							if (pageData.unipndPageList[0].is_lifeauths.indexOf(",") != -1) {
								is_lifeauth = pageData.unipndPageList[0].is_lifeauths.split(",");
							} else {
								is_lifeauth.push(pageData.unipndPageList[0].is_lifeauths)
							}
							let li_upperbound = is_lifeauth.length;
							let index = 0;

							//循环客户号（is_lifeauth:客户号列表）
							for (var i = 0; i < li_upperbound; i++) {
								let li_rowthiscase = 0;
								let dwEu001 = new Array();

								//所有保单列表
								if (dw_eu001 != null) {
									if (ls_acctotallist.length > 0) {

										//循环所有保单列表，把当前保单的符合累计规则的险种抽取出来
										for (var j = 0; j < dw_eu001.length; j++) { //循环所有保单列表

											if (is_chdrnum == dw_eu001[j].chdrnum && dw_eu001[j].clntnum == is_lifeauth[
												i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j].statcode == "PS" ||
													dw_eu001[j].statcode == "UW" || dw_eu001[j].statcode == "MP" ||
													dw_eu001[j].statcode == "PH")) {
												for (var x = 0; x < ls_acctotallist.length; x++) {
													if (dw_eu001[j].crtable == ls_acctotallist[x]) {
														dwEu001[index] = dw_eu001[j]; //提取当前保单和客户号对应的险种
														index++;
														break;
													}
												}
											}
										}
									} else {
										for (var j = 0; j < dw_eu001.length; j++) {
											if (is_chdrnum == dw_eu001[j].chdrnum && dw_eu001[j].clntnum == is_lifeauth[
												i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j].statcode == "PS" ||
													dw_eu001[j].statcode == "UW" || dw_eu001[j].statcode == "MP" ||
													dw_eu001[j].statcode == "PH")) {
												dwEu001[index] = dw_eu001[j];
												index++;
											}
										}
									}
								}

								let index1 = 0;
								li_rowthiscase = dwEu001.length;
								//当前保单符合累计条件的险种
								if (li_rowthiscase > 0) {
									let dwEu001 = new Array();
									if (dw_eu001 != null) {
										if (ls_acctotallist.length > 0) {
											for (var j = 0; j < dw_eu001.length; j++) { //循环所有历史保单
												if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode ==
														"IF" || dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode ==
														"UW" || dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode ==
														"PH")) {
													for (var x = 0; x < ls_acctotallist.length; x++) {
														if (dw_eu001[j].crtable == ls_acctotallist[x]) {
															dwEu001[index1] = dw_eu001[j];
															index1++;
															break;
														}
													}
												}
											}
										} else {
											for (var j = 0; j < dw_eu001.length; j++) {
												if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode ==
														"IF" || dw_eu001[j].statcode == "PS" || dw_eu001[j].statcode ==
														"UW" || dw_eu001[j].statcode == "MP" || dw_eu001[j].statcode ==
														"PH")) {
													dwEu001[index1] = dw_eu001[j];
													index1++;
												}
											}
										}
									}
									let li_roww = dwEu001.length;
									if (li_roww > 0) {
										let ld_total_sumins = 0;
										let acctotallist = [];
										acctotallist = dw.acctotallist;
										ld_total_sumins = dw.ld_total_sumins;
										console.log("ld_total_sumins:" + ld_total_sumins);
										console.log("acctotallist:" + acctotallist);

										let ls_acctotallist_new = acctotallist.split(",");
										// let premiumList = null;
										// let params5 = {
										//   "applnum": pageData.euaa.applnum,
										//   "userId": this.userId
										// }
										// let url = appName.NEWUNDR + '/unipnd/nucleusNote/findEutdpfAll';
										// let res = uwLoadJs.ajaxRequest(params5,url);
										// if(res==null){
										//
										// }else if (res.resultCode == constant.SUCCESS && res.data != null) {
										//   premiumList = res.data;
										// }

										let index2 = 0;
										if (premiumList != null) {
											premium = new Array();
											if (ls_acctotallist_new.length > 0) {
												for (var j = 0; j < premiumList.length; j++) {
													if (premiumList[j].clntnum == is_lifeauth[i]) {
														for (var x = 0; x < ls_acctotallist_new.length; x++) {
															if (premiumList[j].polpln == ls_acctotallist_new[x]) {
																premium[index2] = premiumList[j];
																index2++;
																break;
															}
														}
													}
												}
											} else {
												for (var j = 0; j < premiumList.length; j++) {
													if (premiumList[j].clntnum == is_lifeauth[i] && premiumList[j]
														.polpln == "") {
														premium[index2] = premiumList[j];
														index2++;
													}
												}
											}
										}

										li_roww = premium.length;
										if (li_roww == 0) {
											//无加费记录
											ll_maxem = 0;
										} else {
											ll_maxem = 0;
											ll_maxemtmp = 0;
											for (var y = 0; y < li_roww; y++) {
												if (y == 0) {
													ll_maxem = premium[y].zmortpct;
													if (Number(ll_maxem) > 0 && ls_curren_type == "04") {
														ll_maxem = ll_maxem - 100;
													}
													ll_maxoppc = premium[y].oppc;
													if (ll_maxoppc > ll_maxem) {
														ll_maxemtmp = ll_maxoppc;
													} else {
														ll_maxemtmp = ll_maxem;
													}
												} else {
													ll_maxemtmp = premium[y].zmortpct;
													if (Number(ll_maxemtmp) > 0 && ls_curren_type == "04") {
														ll_maxemtmp = ll_maxemtmp - 100;
													}
													ll_maxoppc = premium[y].oppc;
													if (ll_maxoppc > ll_maxemtmp) {
														ll_maxem = ll_maxoppc;
													}
												}
												if (ll_maxem < ll_maxemtmp) {
													ll_maxem = ll_maxemtmp;
												}
											}
										}

										let li_cnt = 0;
										if (ll_maxem == 0) {
											let params6 = {
												"uwlevel": pageData.unipndPageList[0].is_Uwlevel,
												"acctype": ls_currtypeold,
												"ld_total_sumins": ld_total_sumins + ""
											}
											let url = appName.NEWUNDR + '/unipnd/nucleusNote/findEufupkyCount';
											let res = uwLoadJs.ajaxRequest(params6, url);
											if (res == null) {

											} else if (res.resultCode == constant.SUCCESS && res.data != null) {
												li_cnt = res.data;
											}
										} else {
											let params6 = {
												"uwlevel": pageData.unipndPageList[0].is_Uwlevel,
												"acctype": ls_currtypeold,
												"ld_total_sumins": ld_total_sumins + "",
												"ld_curren_rate": ll_maxem + ""
											}
											let url = appName.NEWUNDR + '/unipnd/nucleusNote/findEufupkyCount';
											let res = uwLoadJs.ajaxRequest(params6, url);
											if (res == null) {

											} else if (res.resultCode == constant.SUCCESS && res.data != null) {
												li_cnt = res.data;
											}
										}

										if (li_cnt == 0) {
											// this.$message({
											//   message: "错误:二级权限Account TYPE:" + ls_curren_type + "超过限额:" + Number(ld_total_sumins).toFixed(2) + "/" + Number(ll_maxem).toFixed(2),
											//   type: 'error'
											// });
											let msg = "错误:二级权限Account TYPE:" + ls_curren_type + "超过限额:" + Number(
												ld_total_sumins).toFixed(2) + "/" + Number(ll_maxem).toFixed(2);
											return msg;
										}

									}
								}
							}
						}
					}
				}

				return "";


			},

			async fGetTotallistpol(as_acctype, as_applnum) {
				let that = this;
				let polplnList = null;
				let ls_totallist = "";

				let params = {
					"applnum": as_applnum,
					"crtables": JSON.stringify(as_acctype)
				}
				// let url = appName.NEWUNDR + '/unipnd/nucleusNote/findPolplnByApplnum';
				// let res = uwLoadJs.ajaxRequest(params,url);
				await findPolplnByApplnum(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						polplnList = res.data;
					}
				}).catch(err => {

				})

				if (polplnList != null) {
					for (let i = 0; i < polplnList.length; i++) {
						if (ls_totallist.length > 0) {
							ls_totallist = ls_totallist + ",";
						}
						ls_totallist = ls_totallist + polplnList[i].polpln.toUpperCase();
					}
				}
				return new Promise((resolve, reject) => {
					resolve(ls_totallist)
				})
				// return ls_totallist;
			},

			//crtable 险种
			wfCheckSharein(crtable, ai_an2, ai_an3, pageData) {
				var ls_acctype = null,
					ls_filter = null,
					ls_filter1 = "";
				var li_row = 0,
					li_return = 1;
				let that = this;
				if (ai_an2 == 1) {
					li_return = this.wfCheckSharein1(crtable, ai_an3, crtable, pageData);
				} else {
					//根据crtable到sppb中获取acctype
					let params = {
						"crtable": crtable
					}
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/findAcctypeFromSppb';
					let res = uwLoadJs.ajaxRequest(params, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						if (res.data.length > 0) {
							ls_acctype = res.data[0].acctype;
							li_return = that.wfCheckSharein1(ls_acctype, ai_an3, crtable, pageData);
						}
					}
				}
				//少了return
				return li_return;
			},
			wfCheckSharein1(acctype, ai_an2, crtable, pageData) {

				let _that = this;
				let is_basic_id = "";
				let is_clntnum_id = "";
				pageData.headClntnumList.forEach(item => {
					if (item.roleflag == "2") {
						is_basic_id = item.idno;
						is_clntnum_id = item.clntnum;
					} else {
						is_basic_id = item.idno;
						is_clntnum_id = item.clntnum;
					}
				})
				let li_return = 1;
				let params = {
					"as_an1": acctype,
					"as_an2": ai_an2,
					"as_an3": crtable,
					"is_dangflag": pageData.is_dangflag,
					"is_indexflag": pageData.is_indexflag,
					"life": pageData.unipndPageList[0].is_lifeauths,
					"is_basic_id": is_basic_id,
					"applnum": pageData.curApplnum,
					"userId": this.userId,
					"clntnum": is_clntnum_id,
					"dw_eu001": JSON.stringify(this.curPageData.dw_eu001)
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/wfCheckSharein1';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					li_return = res.data.flag1;
					pageData.is_dangflag = res.data.flag2;
					pageData.is_indexflag = res.data.flag3;
					pageData.gs_rimsg = Number(res.data.flag4);
				} else {
					li_return = 0;
				}

				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == pageData.curApplnum) {
						datas.push(pageData);
					} else {
						datas.push(item);
					}
				})
				this.pageData = datas;
				return li_return;
			},
			/***************************核决 END**********************************************/


			checkStatus(data) {
				let flag = false;
				data.eubas.forEach(euba => {
					let procflg = euba.procflg;
					let rprntdate = euba.Rprntdate;
					let value = euba.zresnpd;
					if ((procflg == null || procflg == '') && '0' == rprntdate) {
						if (value == '02' || value == '03' || value == '20' || value == '21') {
							flag = true;
						}
					}
				});
				return flag;
			},
			/***************************延期 拒保 BEGIN**********************************************/
			openResolve(pageData, data, type) {
				this.opinionDialogVisible9 = true;
				// this.curResolveList = pageData.idwTrailer7List;
				this.curResolveData = pageData;
				this.curResolveObj = data;
				this.resolveSign = type;

				this.curResolveList = [];
				pageData.idwTrailer7List.forEach(item => {
					if (type == 2) {
						if (pageData.euaa.approval == "D") { //拒保
							if (item.noteType == "01") {
								this.curResolveList.push(item);
							}
						} else if (pageData.euaa.approval == "P") { //延期
							if (item.noteType == "02") {
								this.curResolveList.push(item);
							}
						} else if (pageData.euaa.approval == "W") { //取消
							if (item.noteType == "03") {
								this.curResolveList.push(item);
							}
						}
					} else {
						if (data.approval == "D") { //拒保
							if (item.noteType == "01") {
								this.curResolveList.push(item);
							}
						} else if (data.approval == "P") { //延期
							if (item.noteType == "02") {
								this.curResolveList.push(item);
							}
						} else if (data.approval == "W") { //取消
							if (item.noteType == "03") {
								this.curResolveList.push(item);
							}
						}
					}

				})

				this.carepkyCodes = [];
				if (type == 2) {
					this.curResolveObj.approval = pageData.euaa.approval;
					if (pageData.euaa.approval == "D") { //拒保
						if (this.jbReason.length > 0) {
							this.jbReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = false;
					} else if (pageData.euaa.approval == "P") { //延期
						if (this.yqReason.length > 0) {
							this.yqReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = false;
					} else if (pageData.euaa.approval == "W") { //取消
						if (this.qxReason.length > 0) {
							this.qxReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = true;
					}
				} else {
					if (data.approval == "D") { //拒保
						if (this.jbReason.length > 0) {
							this.jbReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = false;
					} else if (data.approval == "P") { //延期
						if (this.yqReason.length > 0) {
							this.yqReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = false;
					} else if (data.approval == "W") { //取消
						if (this.qxReason.length > 0) {
							this.qxReason.forEach(item => {
								let key = item.noteitem + "-" + item.notedesc;
								item['note'] = key;
								this.carepkyCodes.push(item);
							})
						}
						this.isCancel = true;
					}
				}
				let params = {
					"applnum": pageData.curApplnum,
					"userId": this.userId,
					"clntnum": data.clntnum,
					"chdrnum": data.chdrnum,
					"crtable": this.curResolveObj.crtable
				}
				//獲取原因
				showPostil(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.postilTempVO = res.data;
					} else {
						var lt_time = uwJs.showTime();
						var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12,
							14);
						this.postilTempVO['noteitem'] = "01";
						this.postilTempVO['applnum'] = data.applnum;
						this.postilTempVO['chdrnum'] = data.chdrnum;
						this.postilTempVO['clntnum'] = data.clntnum;
						this.postilTempVO['notecode'] = "";
						this.postilTempVO['crtuser'] = this.userId;
						this.postilTempVO['dtecrt'] = pageData.unipndPageList[0].lda_date;
						this.postilTempVO['crttime'] = ll_time1;
						this.postilTempVO['userProfile'] = this.userId;
						this.postilTempVO['jobName'] = uwconstant.jobName;
						this.postilTempVO['datime'] = this.initTime();
						this.postilTempVO['as_crtable'] = data.crtable;
						this.postilTempVO['ai_pcestrm'] = "0";
						this.postilTempVO['datasqnum'] = "";
						this.postilTempVO['flag'] = "N";
						this.postilTempVO['crtable'] = this.curResolveObj.crtable;
					}
					this.postilTempVO['surname'] = data.as_surname;
					this.postilTempVO['polpln'] = data.polpln;
				}).catch(err => {
					console.log(err)
				})


				this.resolveDisplay();
				if (this.curResolveList.length > 0) {
					let index = 0;
					this.curResolveList.forEach(item => {
						if (item.notecode == "08") {
							item['notedescBg'] = "B";
						}
						item['index'] = index;
						index++;
						item['checked'] = false;
					})
				}

				if (type != 2) {
					if (pageData.euaa.approval && pageData.euaa.approval != "" && pageData.euaa.approval != undefined) {
						this.isRead = true;
					} else {
						if (!this.isApprovalDisabled && !pageData.allInfoReadOnly) {
							this.isRead = false;
						} else {
							this.isRead = true;
						}
					}
				} else {
					if (pageData.unipndPageList[0].ls_approval && pageData.unipndPageList[0].ls_approval != "" && pageData
						.unipndPageList[0].ls_approval != undefined) {
						this.isRead = true;
					} else {
						if (!this.isApprovalDisabled && !pageData.allInfoReadOnly) {
							this.isRead = false;
						} else {
							this.isRead = true;
						}
					}
				}



			},

			//原因码修改
			notecodeChange(data) {
				let list = [];
				let flag = false;
				for (let i = 0; i < this.curResolveList.length; i++) {
					let item = this.curResolveList[i];
					if (data.index != item.index) {
						if (data.notecode == item.notecode) {
							this.popMsg("错误:原因码 " + data.notecode + " 不可重覆", 'error');
							data.notecode = "";
							if (this.isCancel) {
								data.notedesc = "";
							}

							flag = true;
							break;
						}
					}
				}

				if (!flag && this.isCancel) {
					for (let i = 0; i < this.curResolveList.length; i++) {
						let item = this.curResolveList[i];
						if (data.index == item.index) {
							this.carepkyCodes.forEach(carepky => {
								if (data.notecode == carepky.noteitem) {
									item.notedesc = carepky.notedesc;
								}
							})
							// if (item.notecode == "08") {
							//   item['notedescBg'] = "B";
							// } else {
							//   item['notedescBg'] = "RF";
							// }
						}
						list.push(item);
					}
					this.curResolveList = list;
				}

			},
			//新增原因
			addResolve() {
				let notetype = "";
				if (this.curResolveObj.approval == "D") { //拒保
					notetype = "01";
				} else if (this.curResolveObj.approval == "P") { //延期
					notetype = "02";
				} else if (this.curResolveObj.approval == "W") { //取消
					notetype = "03";
				}
				let lt_time = uwJs.showTime();
				let ll_time = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				let resolve = {
					"noteitem": "03",
					"applnum": this.curResolveObj.applnum,
					"chdrnum": this.curResolveObj.chdrnum,
					"clntnum": this.curResolveObj.clntnum,
					"crtable": this.curResolveObj.crtable,
					"reasonType": "",
					"noteType": notetype,
					"crtuser": this.userId,
					"dtecrt": this.curResolveData.unipndPageList[0].lda_date,
					"crttime": ll_time,
					"jobName": uwconstant.jobName,
					"userProfile": this.userId,
					"datime": this.initTime(),
					"as_surname": "",
					"as_crtable": "",
					"ai_pcestrm": "",
					"as_polpln": "",
					"notecode": "",
					"notedesc": "",
					"checked": false,
					"index": this.curResolveList.length + 1
				}

				this.curResolveList.push(resolve);
			},
			//删除原因
			delResolve(data) {
				data.checked = true;
				this.curResolveList = this.curResolveList.filter(item => !item.checked);
				let list = [];
				for (let i = 0; i < this.curResolveList.length; i++) {
					let item = this.curResolveList[i];
					item['index'] = i;
					list.push(item);
				}
				this.curResolveList = list;
			},
			//返回
			resolveBack() {
				if (this.resolveSign == 1) { //险种核保结论
					let euabs = [];
					this.curResolveData.trailer4.forEach(item => {
						if (this.curResolveObj.crtable == item.crtable) {
							console.log("记录核保结论:" + item.approval);
							item.approval = item.oldapproval;
							// item.approval = "";
						}
						euabs.push(item);
					})
					this.curResolveData.trailer4 = euabs;
					this.initPolicyConclusions(this.curResolveData);
				} else if (this.resolveSign == 2) {
					let euabs = [];
					this.curResolveData.trailer4.forEach(item => {
						item.approval = item.oldapproval;
						euabs.push(item);
					})
					this.curResolveData.trailer4 = euabs;
					this.curResolveData.euaa.approval = this.curResolveData.unipndPageList[0].ls_approval;
				}

				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == this.curResolveData.curApplnum) {
						datas.push(this.curResolveData);
					} else {
						datas.push(item);
					}
				})

				this.pageData = datas;
				this.opinionDialogVisible9 = false;
			},
			//保存原因
			saveResolve() {

				let rdatas = [];
				let flag = true;
				// if( this.curResolveList.length==0){
				//   this.$message({
				//     message: "请输入原因",
				//     type: 'error'
				//   });
				//   return false;
				// }

				this.curResolveList.forEach(item => {
					if (item.notecode == "") {
						this.popMsg("必要性栏位:原因码必须输入", 'error');
						flag = false;
						return false;
					}
					// if (item.reasonType == "") {
					//   this.$message({
					//     message: "必要性栏位:原因类型必须输入",
					//     type: 'error'
					//   });
					//   flag = false;
					//   return false;
					// }
					if (item.notedesc == "") {
						this.popMsg("必要性栏位:原因必须输入", 'error');
						flag = false;
						return false;
					}

					item.userProfile = this.userId;
					item.jobName = uwconstant.jobName;
					item.datime = this.initTime();

					rdatas.push(item);
				})
				if (!flag) {
					return false;
				}
				this.curResolveList = rdatas;
				this.pageModifyFlag = true;
				//此处是清除主险的加费信息（当做的是延期、拒保、取消时）
				// //如果上次选的是加费重算保费
				// if(this.curResolveObj.oldapproval=="A" || this.curResolveObj.oldapproval=="B"){
				//   this.clearPre(this.curResolveData, this.curResolveObj);
				// }

				//记录核保结论
				let euabs = [];
				this.curResolveData.trailer4.forEach(item => {
					if (this.curResolveObj.crtable == item.crtable) {
						console.log("记录核保结论:" + item.approval);
						item['oldapproval'] = item.approval;
						this.curResolveObj.approval = item.approval;
					}
					euabs.push(item);
				})
				this.curResolveData.trailer4 = euabs;

				let oldList = [];
				this.curResolveData.idwTrailer7List.forEach(item => {
					if (this.curResolveObj.approval == "D") { //拒保
						if (item.noteType == "02" || item.noteType == "03") {
							oldList.push(item);
						}
					} else if (this.curResolveObj.approval == "P") { //延期
						if (item.noteType == "01" || item.noteType == "03") {
							oldList.push(item);
						}
					} else if (this.curResolveObj.approval == "W") { //取消
						if (item.noteType == "02" || item.noteType == "01") {
							oldList.push(item);
						}
					}
				})

				this.curResolveList.forEach(item => {
					oldList.push(item);
				})


				let datas = [];
				this.pageData.forEach(page => {
					if (page.curApplnum == this.curResolveData.curApplnum) {
						this.curResolveData.idwTrailer7List = oldList;
						datas.push(this.curResolveData);
					} else {
						datas.push(page);
					}
				})
				this.pageData = datas;

				if (this.curResolveList.length == 0) {
					if (this.resolveSign == 1) { //险种结论
						let euabs = [];
						this.curResolveData.trailer4.forEach(item => {
							if (this.curResolveObj.crtable == item.crtable) {
								item['oldapproval'] = "";
								this.curResolveObj.approval = "";
							}
							euabs.push(item);
						})
						this.curResolveData.trailer4 = euabs;
						this.changePolicyConclusions(this.curResolveData);
					} else { //整单结论
						let euabs = [];
						this.curResolveData.trailer4.forEach(item => {
							item['oldapproval'] = "";
							this.curResolveObj.approval = "";
							euabs.push(item);
						})
						this.curResolveData.trailer4 = euabs;

						this.curResolveData.euaa.approval = "";
						this.decideAfter(this.curResolveData);
					}

				} else {
					//生成照会
					if (this.resolveSign == 1) {
						this.addResolveEuba(this.curResolveData, this.curResolveObj.approval, this.curResolveObj, 1);
						this.changeApproval(this.curResolveData);
					} else {
						let flag = this.decideItemchanged(this.curResolveData);
						console.log("===============================" + flag)
						if (!flag) {
							this.curResolveData.euaa.approval = this.curResolveData.unipndPageList[0].ls_approval;
							this.changeSameToOther(this.curResolveData, this.curResolveData.euaa.approval, true);
							this.subUnLoading = false;
							return false;
						}
						this.addResolveEuba(this.curResolveData, this.curResolveData.euaa.approval, this.curResolveObj, 2);
						this.decideAfter(this.curResolveData);

					}
					//保存原因
					if (this.curResolveData.euaa.approval != 'W') {
						this.savePostilByResolve();
					}
				}
				// this.addResolveEuba(this.curResolveData,this.curResolveObj.approval,this.curResolveObj,1);
				this.opinionDialogVisible9 = false;
			},
			//新增延期拒保触发除外保存操作
			savePostilByResolve() {
				var lt_time = uwJs.showTime();
				let postilTemp = this.postilTempVO;
				var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				postilTemp['crtuser'] = this.curResolveData.unipndPageList[0].userId;
				postilTemp['dtecrt'] = this.curResolveData.unipndPageList[0].lda_date;
				postilTemp['crttime'] = ll_time1;
				postilTemp['UserProfile'] = this.curResolveData.unipndPageList[0].userId;
				postilTemp['JobName'] = uwconstant.jobName;
				postilTemp['polpln'] = this.curResolveObj.polpln
				postilTemp['surname'] = this.pageData[0].insLasInfo.name

				let params = {
					"userId": this.curResolveData.unipndPageList[0].userId,
					"crtable": this.curResolveObj.crtable,
					"euta": JSON.stringify(postilTemp),
				}
				savePostil(params).then(res => {
					console.log("延期拒保保存原因成功！")
				}).catch(err => {
					console.log(err)
				})
			},
			//页面控制
			resolveDisplay() {
				if (this.curResolveList.length > 0) {
					this.curResolveList.forEach(item => {
						if (this.curResolveObj.approval == "W") { //可以选择原因码不能输入原因
							item['notecodeBg'] = "B";
							item['notedescBg'] = "RF";
						} else {
							item['notecodeBg'] = "B";
							item['notedescBg'] = "B";
						}
					})
				}

			},

			//pageData:当前保单，approv：结论,curdata:当前险种计划，type 1险种结论，2保单结论
			addResolveEuba(pageData, approv, curdata, type) {
				let lda_date = pageData.unipndPageList[0].lda_date;
				let pcode = ""
				let euab = null;
				let userid = "";
				if (type == 2) {
					//整单结论获取主约
					pageData.trailer4.forEach(item => {
						if ("M" == item.statFund) {
							euab = item;
						}
					})
					if (approv == "P") {
						pcode = "N01";
						userid = this.userId;
					} else if (approv == "D") { //拒保
						pcode = "N02";
						userid = this.userId;
					}
				} else {
					euab = curdata
					pcode = this.getCwPncode(euab.crtable);
				}

				if (pcode == "") {
					return false;
				}

				let params2 = {
					"pncode": pcode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}
				if (lds_pn == null || lds_pn == "") {
					this.popMsg("讯息：照会代码 " + pcode + " 读取错误", 'error');
					return false;
				}

				let lda_reminddate = null;
				let ll_reminddate = 0;
				if (lds_pn != null) {
					let params3 = {
						"ls_date": lda_date,
						"ll_remindday": lds_pn.remindday + ""
					}
					let res1 = uwLoadJs.deteRoll(params3);
					if (res1 == null) {
						return false;
					}
					if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						lda_reminddate = res1.data;
					}
					ll_reminddate = Number(lda_reminddate);
				}

				let eubas = [];
				let flag = false;
				pageData.eubas.forEach(euba => {
					if (euba.pncode == pcode && euba.clntnum == euab.clntnum && euba.rprntdate == "0") {
						euba.reminddate = ll_reminddate;
						euba.remindflg = "N";
						euba.rprntdate = "0";
						euba.pndate = lda_date;
						euba.as_pndate = lda_date;
						euba.procflg = "";
						euba.dateend = "0";
						euba.as_dateend = "0";
						flag = true;
					}
					eubas.push(euba);
				})

				if (flag) {
					pageData.eubas = eubas;
					this.setData(pageData);
					return false;
				}




				//新增照会
				let pntype = this.getPntype(lds_pn.zresnpd);
				let memodesc = pageData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					memodesc = "$$$$$" + uwJs.showTime().substring(2);
				}
				let euba = {
					applnum: pageData.curApplnum,
					zresnpd: lds_pn.zresnpd,
					chdrnum: euab.chdrnum,
					memodesc: memodesc,
					pndate: lda_date,
					dateend: "0",
					forceind: lds_pn.forceind,
					resind: lds_pn.resind,
					prtopt: lds_pn.prtopt,
					zprtcert: lds_pn.authnow,
					reminddate: ll_reminddate,
					remindflg: "N",
					crtuser: "",
					dtecrt: "0",
					crttime: "0",
					nofday: lds_pn.nofday,
					source: lds_pn.source,
					jobName: uwconstant.jobName,
					userProfile: this.userId,
					datime: this.initTime(),
					as_hand: pageData.eufgpkyVO.forceind,
					clntnum: euab.clntnum,
					pncode: pcode,
					procflg: "",
					pedesc: lds_pn.pedesc,
					as_pndate: lda_date,
					rprntdate: "0",
					userid: userid,
					pnfrom: this.userId,
					as_dateend: "0",
					pncodeBg: "B",
					pedescBg: "B",
					clntnumSelectBg: "B",
					pntype: pntype,
					num: pageData.eubas.length
				}

				this.refreshEubas(pageData, euba);
				// pageData.eubas.push(euba);
				// this.setData(pageData);
			},

			getPntype(zresnpd) {
				let type = "1";
				if (zresnpd == "01" ||
					zresnpd == "02" ||
					zresnpd == "03" ||
					zresnpd == "05" ||
					zresnpd == "06" ||
					zresnpd == "04" ||
					zresnpd == "09" ||
					zresnpd == "20" ||
					zresnpd == "21") {
					type = "1";
				} else if (zresnpd == "07") {
					type = "3";
				} else if (zresnpd == "08") {
					type = "2";
				} else {
					type = "4";
				}
				return type;
			},

			//查询险种除外照会代码
			getCwPncode(crtable) {
				let _that = this;
				let pncode = "";
				let params = {
					"crtable": crtable
				}
				let url = appName.NEWUNDR + '/unipnd/postil/findCwPncodeByCrtable';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					pncode = res.data.trim();
				}
				return pncode;
			},
			/***************************延期 拒保 END**********************************************/


			/***************************除外 BEGIN**********************************************/
			//照会码输入自动查询
			layoutAutoComplate1(data) {
				this.paginations.pageIndex = 1;
				this.paginations.pageSize = 15;

				let params = {
					"pageSize": this.paginations.pageSize,
					"pageNumber": this.paginations.pageIndex,
					"pntype": "4",
					"pncode": data.pncode,
					"pedesc": "",
				}
				findPageByDimSelect(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						this.pnCodes = res.data.rows;
						this.paginations.total = res.data.total
					}

				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})
			},
			//选中照会代码
			showPncode1(row, column, event) {
				this.postilTempList[this.pnIndex].pncode = row.pncode;
				// this.postilTempList[this.pnIndex].pedesc = row.pedesc;
				this.postilItemchanged(this.postilTempList[this.pnIndex]);
				this.opinionDialogVisible15 = false;
			},
			// 点击除外弹框 除外代码
			showExcept(e, index) {
				console.log(e);
				console.log(index);
				// this.$refs['excSelect'+index];
				console.log(this.$refs['excSelect' + index]);
				this.gobalExc = this.$refs['excSelect' + index];
				let offset = this.$(this.$refs['excSelect' + index]).offset();
				console.log(this.$(this.$refs['excSelect' + index]).offset())
				this.opinionDialogVisible15 = true;

				this.paginations.pageIndex = 1; // 当前位于哪页
				this.paginations.pageSize = 15;
				this.paginations.pntype = "4"; //批注
				this.paginations.pndesc = "";
				this.pnIndex = index;
				this.searchPncode();

				this.$nextTick(() => {
					this.$('.except-main').offset({
						top: offset.top + 35,
						left: offset.left
					})
				})
			},
			// 除外弹框
			exceptName({
				row,
				rowIndex
			}) {
				row.index = rowIndex;
			},
			// ���费除外弹框
			exceptName1({
				row,
				rowIndex
			}) {
				row.index = rowIndex;
			},
			// 点击加费除外弹框 除外代码
			showExcept1(e, index) {
				console.log(e);
				console.log(index);
				// this.$refs['excSelect'+index];
				console.log(this.$refs['excSelect1' + index]);
				this.gobalExc = this.$refs['excSelect1' + index];
				let offset = this.$(this.$refs['excSelect1' + index]).offset();
				console.log(this.$(this.$refs['excSelect1' + index]).offset())
				this.opinionDialogVisible15 = true;

				this.paginations.pageIndex = 1; // 当前位于哪页
				this.paginations.pageSize = 15;
				this.paginations.pntype = "4"; //批注
				this.paginations.pndesc = "";
				this.pnIndex = index;
				this.searchPncode();

				this.$nextTick(() => {
					this.$('.except-main').offset({
						top: offset.top + 35,
						left: offset.left
					})
				})
			},
			//打开除外弹窗
			openPostil(pageData, data) {
				this.curPostilData = pageData;
				this.curPostilObj = data;

				this.opinionDialogVisible10 = true;
				if (pageData.euaa.approval != "") {
					this.isRead = true;
				} else {
					if (!this.isApprovalDisabled && !pageData.allInfoReadOnly) {
						this.isRead = false;
					} else {
						this.isRead = true;
					}
				}

				let params = {
					"applnum": pageData.curApplnum,
					"userId": this.userId,
					"clntnum": data.clntnum,
					"chdrnum": data.chdrnum,
					"crtable": this.curPostilObj.crtable
				}
				showPostil(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						this.postilTempVO = res.data;
					} else {
						var lt_time = uwJs.showTime();
						var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12,
							14);
						this.postilTempVO['noteitem'] = "01";
						this.postilTempVO['applnum'] = data.applnum;
						this.postilTempVO['chdrnum'] = data.chdrnum;
						this.postilTempVO['clntnum'] = data.clntnum;
						this.postilTempVO['notecode'] = "";
						this.postilTempVO['crtuser'] = this.userId;
						this.postilTempVO['dtecrt'] = pageData.unipndPageList[0].lda_date;
						this.postilTempVO['crttime'] = ll_time1;
						this.postilTempVO['userProfile'] = this.userId;
						this.postilTempVO['jobName'] = uwconstant.jobName;
						this.postilTempVO['datime'] = this.initTime();
						this.postilTempVO['as_crtable'] = data.crtable;
						this.postilTempVO['ai_pcestrm'] = "0";
						this.postilTempVO['datasqnum'] = "";
						this.postilTempVO['flag'] = "N";
						this.postilTempVO['crtable'] = this.curPostilObj.crtable;
					}
					this.postilTempVO['surname'] = data.as_surname;
					this.postilTempVO['polpln'] = data.polpln;
				}).catch(err => {
					// this.loading = false;
					console.log(err)
				})

				this.initPostil(pageData, data);

				console.log(this.postilTempVO)

			},

			//初始化除外列表
			initPostil(pageData, data) {
				let that = this;
				let ls_pn = null;
				let list = [];
				let params = {
					"applnum": pageData.euaa.applnum,
					"clntnum": data.clntnum,
					"chdrnum": data.chdrnum,
					"crtable": data.crtable,
					"userId": this.userId
				}
				let url = appName.NEWUNDR + '/unipnd/postil/findPostilListTempWithCrtable';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {

				} else if (res.resultCode == constant.SUCCESS && res.data != null) {
					ls_pn = "Y";
					that.postilTempList = res.data;
					list = res.data;
				}


				let ls_surname = "";
				if (pageData.idw_client != null) {
					for (var i = 0; i < pageData.idw_client.length; i++) {
						if (pageData.idw_client[i].clntnum == data.clntnum) {
							ls_surname = pageData.idw_client[i].surname;
						}
					}
				}
				pageData.euaa.as_surname = ls_surname;
				pageData.euaa.as_polpln = data.polpln;
				//需要加判断，如果核决以及往后的，则不要查询系统的除外信息了
				if (pageData.euaa.procflg >= 4) {
					return;
				}
				if (ls_pn == "Y") {

				} else {
					let params1 = {
						"applnum": pageData.euaa.applnum,
						"clntnum": data.clntnum,
						"chdrnum": data.chdrnum,
						"userId": this.userId
					}
					let url = appName.NEWUNDR + '/unipnd/postil/findPostilListTemp';
					let res = uwLoadJs.ajaxRequest(params1, url);
					if (res == null) {

					} else if (res.resultCode == constant.SUCCESS && res.data != null) {
						that.postilTempList = res.data;
						list = res.data;
					}
				}

				if (this.postilTempList.length > 0) {
					this.postilTempList.forEach(item => {
						if (item.rprntdate > 0) {
							item['pncodeBg'] = "RF";
							item['pedescBg'] = "RF";
						} else {
							item['pncodeBg'] = "B";
							item['pedescBg'] = "B";
						}
					})
				} else {
					if (data.approval == 'B' || data.approval == 'C') {
						this.setConfigPostil();
					}
				}
				this.curPostilObj['list'] = list;
				console.log(this.curPostilObj['list'])
			},
			//新增除外
			addPostil() {
				let lt_time = uwJs.showTime();
				let ll_time = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);

				let postil = {
					applnum: this.curPostilObj.applnum,
					chdrnum: this.curPostilObj.chdrnum,
					clntnum: this.curPostilObj.clntnum,
					crttime: ll_time,
					crtuser: this.userId,
					dateend: "0",
					as_dateend: "0",
					datime: this.initTime(),
					dtecrt: "0",
					forceind: "",
					jobName: uwconstant.jobName,
					memodesc: "",
					nofday: "0",
					pndate: "0",
					as_pndate: "0",
					pnfrom: this.curPostilObj.crtable,
					crtable: this.curPostilObj.crtable,
					procflg: "",
					prtopt: "",
					reminddate: "0",
					remindflg: "N",
					resind: "",
					rprntdate: "0",
					source: "",
					userProfile: this.userId,
					userid: this.userId,
					zprtcert: "",
					zresnpd: "",
					datasqnum: "",
					flag: "N",
					as_hand: "",
					pncode: "",
					pedesc: "",
					checked: false,
					pncodeBg: "B",
					pedescBg: "B"
				}

				this.postilTempList.push(postil)
			},
			//删除除外
			delPostil(data) {
				data.checked = true;
				this.postilTempList = this.postilTempList.filter(item => !item.checked);
			},

			//批注内容改变
			postilItemchanged(data) {
				let that = this;
				if (data.pncode == "") {
					this.popMsg("错误：照会代码不可为空白", 'error');
					return false;
				}

				let params1 = {
					"pncode": data.pncode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params1);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}

				this.postilItemchangedTemp(lds_pn, data.index);

				this.postilTempList.forEach(item => {
					if (item.index != data.index) {
						if (data.pncode == item.pncode && item.rprntdate == "0") {
							this.popMsg("错误：照会代码 (" + data.pncode + ") 不可重覆", 'error');
							data.pncode = "";
							data.pedesc = "";
							return false;
						}
					}

				});

				this.postilItemchangedTemp(lds_pn, data.index);
			},

			postilItemchangedTemp(lds_pn, index) {
				let that = this;
				if (lds_pn == null || lds_pn == "") {
					this.popMsg("错误：照会代码 (" + this.postilTempList[index].pncode + ") 不存在", 'error');
					this.postilTempList[index].pncode = "";
					return false;
				}

				if (lds_pn.zresnpd != "04") {
					this.popMsg("错误：照会代码 (" + this.postilTempList[index].pncode + ") 不属于批注类", 'error');
					this.postilTempList[index].pncode = "";
					return false;
				}

				let memodesc = this.curPostilData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					memodesc = "$$$$$" + uwJs.showTime().substring(2);
				}

				this.postilTempList[index].zresnpd = lds_pn.zresnpd;
				this.postilTempList[index].pedesc = lds_pn.pedesc;
				this.postilTempList[index].memodesc = memodesc;
				this.postilTempList[index].pndate = this.curPostilData.unipndPageList[0].lda_date;
				this.postilTempList[index].as_pndate = this.curPostilData.unipndPageList[0].lda_date;
				this.postilTempList[index].procflg = "";
				this.postilTempList[index].dateend = "0";
				this.postilTempList[index].as_dateend = "0";
				this.postilTempList[index].forceind = lds_pn.forceind;
				this.postilTempList[index].resind = lds_pn.resind;
				this.postilTempList[index].prtopt = lds_pn.prtopt;
				this.postilTempList[index].zprtcert = lds_pn.authnow;
				this.postilTempList[index].nofday = lds_pn.nofday;
				this.postilTempList[index].userid = "";
				this.postilTempList[index].source = lds_pn.source;
				let lda_reminddate = null;
				if (lds_pn != null) {
					let params3 = {
						"ls_date": this.curPostilData.unipndPageList[0].lda_date,
						"ll_remindday": lds_pn.remindday + ""
					}
					let res1 = uwLoadJs.deteRoll(params3);
					if (res1 == null) {
						return false;
					}
					if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						lda_reminddate = res1.data;
					}
				}
				this.postilTempList[index].reminddate = Number(lda_reminddate);
				this.postilTempList[index].remindflg = "N";
				this.postilTempList[index].rprntdate = "0";
				this.postilTempList[index].as_hand = this.curPostilData.eufgpkyVO.forceind;

			},
			//获取系统配置的除外
			setConfigPostil() {
				let pcode = this.getCwPncode(this.curPostilObj.crtable);
				if (pcode != null && pcode != "") {
					let lds_pn = null;
					let params1 = {
						"pncode": pcode
					}
					let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params1);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						lds_pn = res.data;
					}
					if (lds_pn == null || lds_pn == "") {
						if (!this.isRead) {
							this.popMsg("错误：配置的照会代码 (" + pcode + ") 不存在", 'error');
						}
						return false;
					}

					if (lds_pn.zresnpd != "04") {
						if (!this.isRead) {
							this.popMsg("错误：配置的照会代码 (" + pcode + ") 不属于批注类", 'error');
						}

						return false;
					}
					let lt_time = uwJs.showTime();
					let ll_time = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);

					let postil = {
						applnum: this.curPostilObj.applnum,
						chdrnum: this.curPostilObj.chdrnum,
						clntnum: this.curPostilObj.clntnum,
						crttime: ll_time,
						crtuser: this.userId,
						dateend: "0",
						as_dateend: "0",
						datime: this.initTime(),
						dtecrt: "0",
						forceind: "",
						jobName: uwconstant.jobName,
						memodesc: "",
						nofday: "0",
						pndate: "0",
						as_pndate: "0",
						pnfrom: this.curPostilObj.crtable,
						crtable: this.curPostilObj.crtable,
						procflg: "",
						prtopt: "",
						reminddate: "0",
						remindflg: "N",
						resind: "",
						rprntdate: "0",
						source: "",
						userProfile: this.userId,
						userid: this.userId,
						zprtcert: "",
						zresnpd: "",
						datasqnum: "",
						flag: "N",
						as_hand: "",
						pncode: pcode,
						pedesc: "",
						checked: false,
						pncodeBg: "B",
						pedescBg: "B",
						index: 0
					}
					this.postilTempList.push(postil);
					this.postilItemchangedTemp(lds_pn, 0);
				}
			},
			//除外返回
			postilBack() {
				let euabs = [];
				this.curPostilData.trailer4.forEach(item => {
					if (this.curPostilObj.crtable == item.crtable) {
						console.log("记录核保结论:" + item.approval);
						item.approval = item.oldapproval;
						// item.approval = "";
					}
					euabs.push(item);
				})
				this.curPostilData.trailer4 = euabs;
				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == this.curPostilData.curApplnum) {
						datas.push(this.curPostilData);
					} else {
						datas.push(item);
					}
				})

				this.pageData = datas;
				this.initPolicyConclusions(this.curPostilData);
				this.opinionDialogVisible10 = false;
			},
			//获取险种配置的除外照会
			getPostilPncode() {
				let pcode = this.getCwPncode(this.curPostilObj.crtable);
				if (pcode == null || pcode == "") {
					return false;
				}


				let params2 = {
					"pncode": pcode
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}

				if (lds_pn == null || lds_pn == "") {
					this.popMsg("讯息：照会代码 " + pcode + " 读取错误", 'error');
					return false;
				}

				let lda_reminddate = null;
				let ll_reminddate = 0;
				if (lds_pn != null) {
					let params3 = {
						"ls_date": this.curPostilData.unipndPageList[0].lda_date,
						"ll_remindday": lds_pn.remindday + ""
					}
					let res1 = uwLoadJs.deteRoll(params3);
					if (res1 == null) {
						return false;
					}
					if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						lda_reminddate = res1.data;
					}
					ll_reminddate = Number(lda_reminddate);
				}

				let eubas = [];
				let flag = false;
				this.curPostilData.eubas.forEach(euba => {
					if (euba.pncode == pcode && euba.clntnum == this.curPostilObj.clntnum && euba.rprntdate ==
						"0") {
						flag = true;
						euba.reminddate = ll_reminddate;
						euba.remindflg = "N";
						euba.rprntdate = "0";
						euba.pndate = this.curPostilData.unipndPageList[0].lda_date;
						euba.as_pndate = this.curPostilData.unipndPageList[0].lda_date;
						euba.procflg = "";
						euba.dateend = "0";
						euba.as_dateend = "0";
					}
					eubas.push(euba);
				})


				if (flag) {
					this.setData(this.curPostilData);
					return false;
				}

				let pntype = this.getPntype(lds_pn.zresnpd);
				let memodesc = this.curPostilData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "20") {
					memodesc = "$$$$$" + uwJs.showTime().substring(2);
				}
				let euba = {
					pntype: pntype,
					applnum: this.curPostilData.curApplnum,
					zresnpd: lds_pn.zresnpd,
					chdrnum: this.curPostilObj.chdrnum,
					memodesc: memodesc,
					pndate: this.curPostilData.unipndPageList[0].lda_date,
					dateend: "0",
					forceind: lds_pn.forceind,
					resind: lds_pn.resind,
					prtopt: lds_pn.prtopt,
					zprtcert: lds_pn.authnow,
					reminddate: ll_reminddate,
					remindflg: "N",
					crtuser: "",
					dtecrt: "0",
					crttime: "0",
					nofday: lds_pn.nofday,
					source: lds_pn.source,
					jobName: uwconstant.jobName,
					userProfile: this.userId,
					datime: this.initTime(),
					as_hand: this.curPostilData.eufgpkyVO.forceind,
					clntnum: this.curPostilObj.clntnum,
					pncode: pcode,
					procflg: "",
					pedesc: lds_pn.pedesc,
					as_pndate: this.curPostilData.unipndPageList[0].lda_date,
					rprntdate: "0",
					userid: "",
					pnfrom: this.userId,
					as_dateend: "0",
					pncodeBg: "B",
					pedescBg: "B",
					clntnumSelectBg: "B",
					num: this.curPostilData.eubas.length
				}

				this.refreshEubas(this.curPostilData, euba);
				// this.curPostilData.eubas.push(euba);
				// this.setData(this.curPostilData);

			},
			//点击确定
			savePostil(type) {
				let that = this;
				this.subUnLoading = true;
				this.pageModifyFlag = true;
				this.savePostilTimeOut = setTimeout(function() {
					if (that.postilTempVO.notedesc == "") {
						if (that.postilTempList.length > 0) {
							that.popMsg("错误：批注作业~主档未输入,明细档不可新增", 'error');
							that.subUnLoading = false;
							return false;
						}
					} else {
						for (let i = 0; i < that.postilTempList.length; i++) {
							let item = that.postilTempList[i];
							if (item.pncode == 0 || item.pncode == "") {
								that.popMsg("必要性栏位：批注代码必须输入", 'error');
								that.subUnLoading = false;
								return false;
							}
							if (item.pedesc == 0 || item.pedesc == "") {
								that.popMsg("必要性栏位：批注内容必须输入", 'error');
								that.subUnLoading = false;
								return false;
							}
						}

					}

					that.pageModifyFlag = true;
					let ls_modify = "N";
					let li_cnt = 0;
					let li_trailer = that.postilTempList.length;
					if (li_trailer == 0) {
						//如果上次选的是加费重算保费
						if (type == 1) {
							if (that.curPostilObj.oldapproval == "A" || that.curPostilObj.oldapproval == "B") {
								that.clearPre(that.curPostilData, that.curPostilObj);
							}
							//除外列表为空清空结论
							if (that.postilTempList && that.postilTempList.length == 0) {
								that.curPostilObj.approval = "";
							}
						}

						//记录核保结论
						let euabs = [];
						that.curPostilData.trailer4.forEach(item => {
							if (that.curPostilObj.crtable == item.crtable) {
								console.log("记录核保结论:" + item.approval);
								item['oldapproval'] = item.approval;
							}
							euabs.push(item);
						})
						that.curPostilData.trailer4 = euabs;
						that.setData(that.curPostilData);

						that.wfNotePersave();
						that.changeApproval(that.curPostilData);
						that.opinionDialogVisible10 = false;
						that.subUnLoading = false;
						return false;
					}
					// let oldList = that.curPostilObj.list;//原来的数据
					// //判断是否更新过数据
					// while (li_cnt <= li_trailer || ls_modify == "Y") {
					//   let size = oldList == null ? 0 : oldList.length;
					//   if (li_trailer != size) {
					//     li_cnt = 1;
					//   } else {
					//     if (li_trailer == 0 && size == 0) {
					//       li_cnt = 0;
					//     } else {
					//       for (var i = 0; i < size; i++) {
					//         if (oldList[i].pncode != that.postilTempList[i].pncode || oldList[i].pedesc != that.postilTempList[i].pedesc) {
					//           li_cnt = 1;
					//           break;
					//         }
					//       }
					//     }
					//   }
					//   if (li_cnt <= 0) {
					//     let params = {
					//       "euta": JSON.stringify(that.postilTempVO),
					//       "userId": that.userId
					//     }
					//     savePostilHead(params).then(res => {
					//
					//     }).catch(err => {
					//       console.log(err)
					//     })
					//     break;
					//   }
					//   ls_modify = "Y";
					//   break;
					// }
					//
					// if (ls_modify != "Y") {
					//   that.opinionDialogVisible10 = false;
					//   that.subUnLoading = false;
					//   return false;
					// }

					//获取险种配置的照会信息
					// that.getPostilPncode();

					let params2 = {
						"pncode": "EE1"
					}
					let lds_pn = null;
					let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						lds_pn = res.data;
					}


					let lda_reminddate = null;
					let ll_reminddate = 0;
					if (lds_pn != null) {
						let params3 = {
							"ls_date": that.curPostilData.unipndPageList[0].lda_date,
							"ll_remindday": lds_pn.remindday + ""
						}
						let res1 = uwLoadJs.deteRoll(params3);
						if (res1 == null) {
							return false;
						}
						if (res1.resultCode == constant.SUCCESS && res1.data != null) {
							lda_reminddate = res1.data;
						}

						ll_reminddate = Number(lda_reminddate);
					}

					let eubas = [];
					let newEuba = null;
					let flag = false;
					that.curPostilData.eubas.forEach(euba => {
						if (euba.pncode == "EE1" && euba.clntnum == that.curPostilObj.clntnum && euba
							.rprntdate == "0") {
							if (lds_pn == null || lds_pn == "") {
								that.popMsg("讯息：照会代码 EE1 读取错误", 'error');
								that.wfNotePersave();
								that.opinionDialogVisible10 = false;
								that.subUnLoading = false;
								return false;
							}
							flag = true;
							euba.reminddate = ll_reminddate;
							euba.remindflg = "N";
							euba.rprntdate = "0";
							euba.pndate = that.curPostilData.unipndPageList[0].lda_date;
							euba.as_pndate = that.curPostilData.unipndPageList[0].lda_date;
							euba.procflg = "";
							euba.dateend = "0";
							euba.as_dateend = "0";
							newEuba = euba;
						} else {
							eubas.push(euba);
						}
					})


					if (flag) {
						that.curPostilData.eubas = eubas;
						if (newEuba != null) {
							that.refreshEubas(that.curPostilData, newEuba);
						}

						let datas = [];
						that.pageData.forEach(item => {
							if (item.curApplnum == that.curPostilData.curApplnum) {
								datas.push(that.curPostilData);
							} else {
								datas.push(item);
							}
						})
						that.pageData = datas;

						//如果上次选的是加费重算保费
						if (type == 1) {
							if (that.curPostilObj.oldapproval == "A" || that.curPostilObj.oldapproval == "B") {
								that.clearPre(that.curPostilData, that.curPostilObj);
							}
							//除外列表为空清空结论
							if (that.postilTempList && that.postilTempList.length == 0) {
								that.curPostilObj.approval = "";
							}
						}

						//记录核保结论
						let euabs = [];
						that.curPostilData.trailer4.forEach(item => {
							if (that.curPostilObj.crtable == item.crtable) {
								console.log("记录核保结论:" + item.approval);
								item['oldapproval'] = item.approval;
							}
							euabs.push(item);
						})
						that.curPostilData.trailer4 = euabs;
						that.setData(that.curPostilData);

						that.wfNotePersave();
						that.changeApproval(that.curPostilData);
						that.opinionDialogVisible10 = false;
						that.subUnLoading = false;
						return false;
					}

					if (lds_pn == null || lds_pn == "") {
						that.popMsg("讯息：照会代码 EE1 读取错误", 'error');
						that.wfNotePersave();
						that.opinionDialogVisible10 = false;
						that.subUnLoading = false;
						return false;
					}

					//新增EE1照会
					let pntype = that.getPntype(lds_pn.zresnpd);
					let memodesc = that.curPostilData.euaa.tsalesunt + uwJs.showTime().substring(2);
					if (lds_pn.zresnpd == "20") {
						memodesc = "$$$$$" + uwJs.showTime().substring(2);
					}
					let euba = {
						pntype: pntype,
						applnum: that.curPostilData.curApplnum,
						zresnpd: lds_pn.zresnpd,
						chdrnum: that.curPostilObj.chdrnum,
						memodesc: memodesc,
						pndate: that.curPostilData.unipndPageList[0].lda_date,
						dateend: "0",
						forceind: lds_pn.forceind,
						resind: lds_pn.resind,
						prtopt: lds_pn.prtopt,
						zprtcert: lds_pn.authnow,
						reminddate: ll_reminddate,
						remindflg: "N",
						crtuser: "",
						dtecrt: "0",
						crttime: "0",
						nofday: lds_pn.nofday,
						source: lds_pn.source,
						jobName: uwconstant.jobName,
						userProfile: that.userId,
						datime: that.initTime(),
						as_hand: that.curPostilData.eufgpkyVO.forceind,
						clntnum: that.curPostilObj.clntnum,
						pncode: "EE1",
						procflg: "",
						pedesc: lds_pn.pedesc,
						as_pndate: that.curPostilData.unipndPageList[0].lda_date,
						rprntdate: "0",
						userid: "",
						pnfrom: that.userId,
						as_dateend: "0",
						pncodeBg: "B",
						pedescBg: "B",
						clntnumSelectBg: "B",
						num: that.curPostilData.eubas.length
					}

					that.refreshEubas(that.curPostilData, euba);
					// that.curPostilData.eubas.push(euba);
					let datas = [];

					if (type == 1) {
						if (that.curPostilObj.oldapproval == "A" || that.curPostilObj.oldapproval == "B") {
							that.clearPre(that.curPostilData, that.curPostilObj);
						}
					}

					//记录核保结论
					let euabs = [];
					that.curPostilData.trailer4.forEach(item => {
						if (that.curPostilObj.crtable == item.crtable) {
							console.log("记录核保结论:" + item.approval);
							item['oldapproval'] = item.approval;
						}
						euabs.push(item);
					})
					that.curPostilData.trailer4 = euabs;
					that.setData(that.curPostilData);

					that.wfNotePersave();
					that.changeApproval(that.curPostilData);
					that.opinionDialogVisible10 = false;
					that.subUnLoading = false;
					return true;
				}, 100)



			},
			wfNotePersave() {
				var lt_time = uwJs.showTime();
				var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				this.postilTempVO.crtuser = this.curPostilData.unipndPageList[0].userId;
				this.postilTempVO.dtecrt = this.curPostilData.unipndPageList[0].lda_date;
				this.postilTempVO.crttime = ll_time1;
				this.postilTempVO.UserProfile = this.curPostilData.unipndPageList[0].userId;
				this.postilTempVO.JobName = uwconstant.jobName;

				this.wfPmPresave(this.curPostilData, 4);
				let params = {
					"userId": this.curPostilData.unipndPageList[0].userId,
					"crtable": this.curPostilObj.crtable,
					"euta": JSON.stringify(this.postilTempVO),
					"eutbList": JSON.stringify(this.postilTempList)
				}
				savePostil(params).then(res => {
					this.triggerTrailer1();
					this.useDisplay(this.curPostilData);
				}).catch(err => {
					console.log(err)
				})

			},
			wfPmPresave(pageData, ai_idx) {
				let that = this;
				let ls_med02 = "";
				let ls_med03 = "";
				if (ai_idx == 1) {
					pageData.eubas.forEach(euba => {
						if (euba.pntype == "1") {
							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "02" && ls_med02 != "1") {
								ls_med02 = "1";
							}

							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "03" && ls_med03 != "1") {
								ls_med03 = "1";
							}
						}
					})
				} else if (ai_idx == 2) {
					pageData.eubas.forEach(euba => {
						if (euba.pntype == "2") {
							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "02" && ls_med02 != "1") {
								ls_med02 = "1";
							}

							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "03" && ls_med03 != "1") {
								ls_med03 = "1";
							}
						}
					})
				} else if (ai_idx == 3) {
					pageData.eubas.forEach(euba => {
						if (euba.pntype == "3") {
							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "02" && ls_med02 != "1") {
								ls_med02 = "1";
							}

							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "03" && ls_med03 != "1") {
								ls_med03 = "1";
							}
						}
					})
				} else if (ai_idx == 4) {
					pageData.eubas.forEach(euba => {
						if (euba.pntype == "4") {
							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "02" && ls_med02 != "1") {
								ls_med02 = "1";
							}

							if (euba.procflg == "" && Number(euba.rprntdate) == 0 &&
								euba.zresnpd == "03" && ls_med03 != "1") {
								ls_med03 = "1";
							}
						}
					})
				}

				if (ls_med02 == "1" && ls_med03 == "") {
					this.popMsg("讯息：有体检原因，无体检项目!!!!", 'error');
					return -1;
				}
				if (ls_med02 == "" && ls_med03 == "1") {
					this.popMsg("讯息：有体检项目，无体检原因!!!!", 'error');
					return -1;
				}

				let ls_appind = pageData.appind;
				if (ls_appind == "Y") {
					let eubas = [];
					pageData.eubas.forEach(euba => {
						if (euba.pndate <= pageData.unipndPageList[0].lda_date &&
							euba.procflg == "" &&
							Number(euba.rprntdate) == 0) {
							let params = {
								"pncode": euba.pncode
							}
							let lds_pn = null;
							let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params);
							if (res == null) {
								return false;
							}
							if (res.resultCode == constant.SUCCESS && res.data != null) {
								lds_pn = res.data;
							}

							if (lds_pn == null || lds_pn == "") {
								this.popMsg("讯息：照会代码 (" + euba.pncode + ") 读取错误", 'error');
								return false; //point:这里是自己加的，pb中没有
							}

							let params2 = {
								"ls_date": pageData.unipndPageList[0].lda_date,
								"ll_remindday": lds_pn.remindday + ""
							}
							let lda_reminddate = "0";
							let res1 = uwLoadJs.deteRoll(params2);
							if (res1 == null) {
								return false;
							}
							if (res1.resultCode == constant.SUCCESS && res1.data != null) {
								lda_reminddate = res1.data;
							}

							let ls_date = pageData.unipndPageList[0].lda_date;
							let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) + "-" + ls_date
								.substring(6, 8);
							let lt_time = uwJs.showTime();
							let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) + ":" +
								lt_time.substring(12, 14);
							let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time
								.substring(12, 14);

							euba.reminddate = Number(lda_reminddate);
							euba.remindflg = "N";
							euba.rprntdate = "0";
							euba.pndate = pageData.unipndPageList[0].lda_date;
							euba.as_pndate = pageData.unipndPageList[0].lda_date;
							euba.userid = pageData.unipndPageList[0].userId;
							euba.crtuser = pageData.unipndPageList[0].userId;
							euba.dtecrt = pageData.unipndPageList[0].lda_date;
							euba.crttime = ll_time1;
							euba.userProfile = pageData.unipndPageList[0].userId;
							euba.jobName = uwconstant.jobName;
							euba.datime = this.initTime();
						}
						eubas.push(euba);
					});

					pageData.eubas = eubas;
				}

				let datas = [];
				this.pageData.forEach(data => {
					if (data.curApplnum == pageData.curApplnum) {
						datas.push(pageData);
					} else {
						datas.push(data);
					}
				})
				this.pageData = datas;

			},

			triggerTrailer1() {
				let _that = this;
				//删除全部批注类照会
				let eubas = [];
				_that.curPostilData.eubas.forEach(euba => {
					if (euba.zresnpd == "04" && euba.pncode != "EE1" && euba.pnfrom == _that.curPostilObj
						.crtable) {
						//如果批注类照会已经被核销或者已经打印，禁止删除---褚四锋
						if (euba.rprntdate != 0 || euba.dateend != 0 || euba.userid != '') {
							//该批注类照会已经下发或者核销，不允许再删除
							eubas.push(euba);
						}
						//如果批注类照会已经被核销或者已经打印，禁止删除---褚四锋
					} else {
						eubas.push(euba);
					}
				})
				_that.curPostilData.eubas = eubas;
				//查询出当前受理号所有批注类照会放入照会事项中
				let params = {
					"applnum": _that.curPostilData.curApplnum,
					"userId": _that.userId,
				}
				let pnfrom = _that.curPostilObj.crtable;
				findPostilListWithTrailer1(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data) {
						let list = res.data;
						list.forEach(item => {
							if (item.pnfrom == pnfrom) {
								let pntype = item.pntype;
								if (!item.pntype) {
									pntype = this.getPntype(item.zresnpd);
								}
								let euba = {
									pntype: pntype,
									applnum: item.curApplnum,
									zresnpd: item.zresnpd,
									chdrnum: item.chdrnum,
									memodesc: item.memodesc,
									pndate: _that.curPostilData.unipndPageList[0].lda_date,
									dateend: "0",
									forceind: item.forceind,
									resind: item.resind,
									prtopt: item.prtopt,
									zprtcert: item.authnow,
									reminddate: item.reminddate,
									remindflg: item.remindflg,
									crtuser: item.crtuser,
									dtecrt: item.dtecrt,
									crttime: item.crttime,
									nofday: item.nofday,
									source: item.source,
									jobName: item.jobName,
									userProfile: item.userProfile,
									datime: item.datime,
									as_hand: _that.curPostilData.eufgpkyVO.forceind,
									clntnum: item.clntnum,
									pncode: item.pncode,
									procflg: item.procflg,
									pedesc: item.pedesc,
									as_pndate: item.pndate,
									rprntdate: item.rprntdate,
									userid: item.userid,
									pnfrom: item.pnfrom,
									as_dateend: "",
									pncodeBg: "B",
									pedescBg: "B",
									clntnumSelectBg: "B",
									num: _that.curPostilData.eubas.length
								}
								//判断该险种除外是否已经存在了，存在了不重复增加--褚四锋
								let isContain = false;
								_that.curPostilData.eubas.forEach(ite => {
									if (ite.pnfrom == item.pnfrom && ite.pncode == item.pncode &&
										ite.zresnpd == "04" && ite.pncode != "EE1") {
										isContain = true;
									}
								})
								if (!isContain) {
									if (item.procflg != "") {
										_that.curPostilData.eubas.push(euba);
									} else {
										_that.refreshEubas(_that.curPostilData, euba);

									}
									//如果包含了,内容被更新过，就替换内容，其他不变 ---褚四锋
								} else {
									_that.curPostilData.eubas.forEach(item => {
										if (item.pncode == euba.pncode) {
											//内容是否被更改了
											if (item.pedesc.trim() != euba.pedesc.trim()) {
												item['pedesc'] = euba.pedesc.trim();
											}
										}
									})
									_that.setData(_that.curPostilData);
								}
							}
						})
					}

					let datas = [];
					_that.pageData.forEach(item => {
						if (item.curApplnum == _that.curPostilData.curApplnum) {
							datas.push(this.curPostilData);
						} else {
							datas.push(item);
						}
					})
					_that.pageData = datas;

				}).catch(err => {
					console.log(err)
				})


			},

			//刷新照会
			refreshEubas(pageData, euba) {
				let eubas = [];
				eubas.push(euba);
				pageData.eubas.forEach(euba => {
					eubas.push(euba);
				})
				pageData.eubas = eubas;
				this.setData(pageData);
			},
			/***************************除外 END**********************************************/

			/***************************加费 BEGIN**********************************************/
			//加费主档内容改变后
			premiumItemchanged(data) {
				let ll_phi = 0,
					ll_pwp = 0,
					ll_prt = 0;
				if (isNaN(data.pwp) == true) {
					ll_pwp = 0;
				} else {
					ll_pwp = Number(data.pwp).toFixed(2);
				}
				if (isNaN(data.phi) == true) {
					ll_phi = 0;
				} else {
					ll_phi = Number(data.phi).toFixed(2);
				}

				ll_prt = (ll_phi * 30 + ll_pwp * 15) / 100;
				data.prt = Number(ll_prt).toFixed(0)
			},
			//TM改变
			zmortpctChange(data) {
				let that = this;
				let ll_d = 0;
				let ld_ratio = 0;
				let ld_hsumin = 0;
				let ld_lsumin = 0;
				let ls_pmsts = "";
				let ls_sasts = "";
				let id_sumin = 0;
				let euis019 = {};

				if (isNaN(data.zmortpct) == true) {
					data.zmortpct = 0;
				} else {
					ll_d = Number(data.zmortpct) - 100;
					if (ll_d < 0) {
						ll_d = 0;
					}


					if (this.curAddPremObj.crtable == "UR02" || this.curAddPremObj.crtable == "URGT") {
						let params = {
							"asFunction": "SAPM",
							"alOccdate": this.curAddPremData.euaa.effdate + "",
							"asCrtable": this.curAddPremObj.crtable + "",
							"asSex": this.curAddPremObj.sex + "",
							"alAge": this.curAddPremObj.age + "",
							"alOppc": ll_d + "",
							"alSumin": this.curAddPremObj.sumins + "",
							"alInstprem": this.curAddPremObj.instprem + "",
							"asBillfreq": this.curAddPremData.euaa.billfreq + "",
							"adRatio": ld_ratio + "",
							"adHsumin": ld_hsumin + "",
							"adLsumin": ld_lsumin + "",
							"asPmstatuz": ls_pmsts + "",
							"asSastatuz": ls_sasts + "",
							"applnum": this.curAddPremObj.applnum + "",
						}
						let res = uwLoadJs.callEuis019(params);
						if (res == null) {

						} else if (res.resultCode == constant.SUCCESS && res.data != null) {
							euis019 = res.data;
							if (euis019 != null) {
								id_sumin = euis019.alSumin;
								ld_hsumin = euis019.adHsumin;
							}
							if (id_sumin > ld_hsumin) {
								this.curAddPremObj.is_RULtimes = "B";
							} else {
								this.curAddPremObj.is_RULtimes = "L";
							}
						}
					}
				}

				//获取该险种加费上限
				let ls_acctype = null;
				let params1 = {
					"crtable": this.curAddPremObj.crtable
				}
				let url = appName.NEWUNDR + '/unipnd/premium/findAcctypeByCrtable';
				let res = uwLoadJs.ajaxRequest(params1, url);
				if (res == null) {

				} else if (res.resultCode == constant.SUCCESS && res.data != null) {
					ls_acctype = res.data;
				}

				if (ls_acctype == null || ls_acctype == "") {
					that.popMsg("错误：OPPC 1  险种:" + this.curAddPremObj.crtable + " 没有配置风险累计保额类型", 'error');
					data.zmortpct = 0;
					return false;
				}

				let ls_acctypeold = ls_acctype;
				if (ls_acctype != "" && ls_acctype.length == 2) {
					ls_acctype = ls_acctype.substring(1);
				} else {
					ls_acctype = (Number(ls_acctype) + "");
				}

				let ld_rateup = 0;
				let ls_sublvlind = null;
				let ls_unitind = null;
				let ld_rate = 0;
				let params2 = {
					"uwlevel": this.curAddPremData.unipndPageList[0].is_Uwlevel,
					"acctype": ls_acctype
				}
				let res1 = uwLoadJs.findAgcomrtByUwlevel(params2);
				if (res1 == null) {

				} else if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					ld_rateup = res1.data.AGCOMRT;
					ls_sublvlind = res1.data.FLAG01;
					ls_unitind = res1.data.FLAG02;
				} else {
					that.popMsg("错误：1  核保等级:" + that.curAddPremData.unipndPageList[0].is_Uwlevel + " 核保类型:" + ls_acctype +
						" 没有授权", 'error');
					data.zmortpct = 0;
					return false;
				}
				let params3 = {
					"crtable": this.curAddPremObj.crtable
				}
				let url3 = appName.NEWUNDR + '/unipnd/premium/isRaflag';
				let res3 = uwLoadJs.ajaxRequest(params3, url3);
				let flag = false;
				if (res3 && res3.data) {
					flag = res3.data;
				}

				if (ls_sublvlind != "Y") {
					let num = 0;
					//是否重疾险按寿险加费对加费值-100
					if (flag) {
						num = Number(data.zmortpct) - 100;
					} else {
						num = Number(data.zmortpct);
					}

					if (Number(num) > Number(ld_rateup)) {
						that.popMsg("错误：1 加费数值超过权限" + ld_rate, 'error');
						data.zmortpct = 0;
						return false;
					} else {
						return false;
					}
				}

				let ls_acctotallist = this.fGetTotallist(ls_acctypeold);
				ls_acctotallist = ls_acctotallist.split(",");
				let is_lifeauth = this.curAddPremData.unipndPageList[0].is_lifeauths.split(",");
				let li_upperbound = is_lifeauth.length;

				let dwEu001 = [];
				let idsEula = [];
				let li_roww = 0;
				let ld_total_sumins = 0;
				let ld_sumins = 0;
				let ld_sumins_dang = 0;
				let ld_cedprm = 0;
				let ls_crtable = null;
				let ids_eula = this.curAddPremData.ids_eula;

				for (let i = 0; i < li_upperbound; i++) {
					let index = 0;
					if (this.curAddPremData.dw_eu001 != null) {
						let dw_eu001 = this.curAddPremData.dw_eu001;
						for (let j = 0; j < dw_eu001.length; j++) {
							if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j]
									.statcode == "PS" || dw_eu001[j].statcode == "UW" || dw_eu001[j].statcode == "MP" ||
									dw_eu001[j].statcode == "PH" || dw_eu001[j].statcode == "PU" || dw_eu001[j].statcode ==
									"WV")) {
								for (let x = 0; x < ls_acctotallist.length; x++) {
									if (dw_eu001[j].crtable == ls_acctotallist[x]) {
										dwEu001[index] = dw_eu001[j];
										index++;
										break;
									}
								}
							}
						}
					}

					li_roww = dwEu001.length;
					///获得本单本类型的保额
					ld_total_sumins = 0;

					for (let j = 0; j < li_roww; j++) {
						ld_sumins = 0
						ld_sumins = dwEu001[j].sumins;
						ld_sumins_dang = dwEu001[j].suminsDang;
						ld_cedprm = dwEu001[j].cedprm;
						let ls_statcode = dwEu001[j].statcode;
						let ls_acctype1 = dwEu001[j].acctype;
						//处理年金A款保额计算
						let ld_instprem = dwEu001[j].instprem;
						let ll_billfreq = Number(dwEu001[j].fupdesc);
						if (ll_billfreq == 0) {
							ll_billfreq = 1;
						}
						let ld_instprem_year = ll_billfreq * ld_instprem;
						let ld_danger = ld_sumins_dang * ld_cedprm;
						// if (ls_acctype1 == "01") {
						//   ld_sumins = this.fGetWpSumins(ll_billfreq, ld_sumins);
						// }
						ld_sumins = ld_sumins * ld_cedprm;
						ls_crtable = dwEu001[j].crtable;

						if (ids_eula != null) {
							for (let x = 0; x < ids_eula.length; x++) {
								if (ids_eula[x].crtable == ls_crtable && ids_eula[x].acctype == ls_acctypeold) {
									idsEula[0] = ids_eula[x];
									break;
								}
							}
						}

						if (idsEula.length > 0) {
							let ld_percent = idsEula[0].percent01;
							if (idsEula[0].flag02 == "Y") {
								ld_percent = idsEula[0].percent02;
								ld_sumins = Number(ld_instprem_year) * Number(ld_percent);
							} else {
								ld_sumins = ld_sumins * ld_percent;
							}
						}
						ld_total_sumins = Number(ld_total_sumins) + Number(ld_sumins);
					}

					if (ls_unitind != "Y") {
						ld_total_sumins = Number(ld_total_sumins) / 10000;
					}

					let ld_curren_rate = Number(data.zmortpct);
					if (ls_acctype == "4") {
						ld_curren_rate = ld_curren_rate - 100;
					}
					//是否重疾险按寿险加费对加费值-100
					if (flag) {
						ld_curren_rate = Number(ld_curren_rate) - 100;
					}
					let li_cnt = 0;


					let params3 = {
						"uwlevel": this.curAddPremData.unipndPageList[0].is_Uwlevel,
						"acctype": ls_acctype,
						"ld_total_sumins": ld_total_sumins,
						"ld_curren_rate": ld_curren_rate
					}
					let res1 = uwLoadJs.findEufupkyCount(params3);
					if (res1 == null) {

					} else if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						li_cnt = res.data;
					}
					if (li_cnt == 0) {
						this.popMsg("错误：1 加费值超过权限" + ld_rate, 'error');
						data.zmortpct = 0;
						return false;
					}
				}


			},
			//加费类别改变
			opcdaChange(data) {
				this.curAddPremData.is_calc = "Y";

				let ls_short = uwJs.space(10);
				let ls_long = uwJs.space(30);
				let ls_rtncd = uwJs.space(1);
				let ls_rtnsts = uwJs.space(4);
				let ls_key = this.curAddPremObj.crtable + data.opcda;

				let params = {
					"company": this.curAddPremData.unipndPageList[0].usercomp,
					"lsLongdesc": ls_long,
					"lsRtncd": ls_rtncd,
					"lsRtnsts": ls_rtnsts,
					"lsShortdesc": ls_short,
					"lsSrcebus": ls_key,
					"table": "T5657",
				}
				callEuis006(params).then(res => {
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						if (res.data.lsRtncd.trim() != "") {
							this.popMsg("错误：" + res.data.lsRtncd + "   " + res.data.lsRtnsts + "选择加费类别有误",
							'error');
							data.opcda = "";
							return false;
						}
					} else {
						this.popMsg("错误：选择加费类别有误", 'error');
						data.opcda = "";
						return false;
					}
				}).catch(err => {
					console.log(err)
				});
			},
			//加费百分比改变
			oppcChange(data) {
				let that = this;
				if (isNaN(data.oppc) == true) {
					data.oppc = 0;
				}
				this.curAddPremData.is_calc = "Y";

				if (isNaN(data.oppc) == false) {
					let ls_oppc = data.oppc;
					let ll_dec = ls_oppc.indexOf(".");

					if (Number(data.oppc) > 999.99 || Number(data.oppc) <= 0.009 && Number(data.oppc) != 0) {
						this.popMsg("错误： 数值格式输入错误", 'error');
						data.oppc = 0;
						return false;
					}

					let ls_acctype = null;
					let params1 = {
						"crtable": this.curAddPremObj.crtable
					}
					let url = appName.NEWUNDR + '/unipnd/premium/findAcctypeByCrtable';
					let res = uwLoadJs.ajaxRequest(params1, url);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						ls_acctype = res.data;
					}

					if (ls_acctype == null || ls_acctype == "") {
						if (that.curAddPremObj.crtable != "HLA4" && that.curAddPremObj.crtable != "HS0S") {
							that.popMsg("错误：2 OPPC 险种:" + this.curAddPremObj.crtable + " 没有配置风险累计保额类型", 'error');
							data.oppc = 0;
							return false;
						}
					}

					let ls_acctypeold = ls_acctype;
					if (ls_acctype.length == 2) {
						ls_acctype = ls_acctype.substring(1);
					} else {
						ls_acctype = (Number(ls_acctype) + "").trim();
					}

					let ld_rateup = 0;
					let ls_sublvlind = null;
					let ls_unitind = null;
					let ld_rate = 0;
					let params2 = {
						"uwlevel": this.curAddPremData.unipndPageList[0].is_Uwlevel,
						"acctype": ls_acctype
					}
					let url1 = appName.NEWUNDR + '/unipnd/premium/findAgcomrtByUwlevel';
					let res1 = uwLoadJs.ajaxRequest(params2, url1);
					if (res1 == null) {
						return false;
					}
					if (res1.resultCode == constant.SUCCESS && res1.data != null) {
						ld_rateup = res1.data.AGCOMRT;
						ls_sublvlind = res1.data.FLAG01;
						ls_unitind = res1.data.FLAG02;
					} else {
						that.popMsg("错误：1  核保等级:" + that.curAddPremData.unipndPageList[0].is_Uwlevel + " 核保类型:" +
							ls_acctype + " 没有授权", 'error');
						data.oppc = 0;
						return false;
					}

					if (ls_sublvlind != "Y") {
						let ld_rate = that.fGetRateupRate(this.curAddPremObj.crtable, this.curAddPremData.unipndPageList[0]
							.userId);
						if (Number(data.oppc) > ld_rate) {
							that.popMsg("错误：2 OPPC加费数值超过权限LEVEL 1" + ld_rate, 'error');
							data.oppc = 0;
							return false;
						}
					}

					let ls_acctotallist = that.fGetTotallist(ls_acctypeold);
					ls_acctotallist = ls_acctotallist.split(",");
					let is_lifeauth = that.curAddPremData.unipndPageList[0].is_lifeauths.split(",");
					let li_upperbound = is_lifeauth.length;

					let dwEu001 = [];
					let idsEula = [];
					let dw_eu001 = this.curAddPremData.dw_eu001;
					let ids_eula = this.curAddPremData.ids_eula;

					for (let i = 0; i < li_upperbound; i++) {
						let index = 0;
						if (dw_eu001 != null) {
							for (let j = 0; j < dw_eu001.length; j++) {
								if (dw_eu001[j].clntnum == is_lifeauth[i] && (dw_eu001[j].statcode == "IF" || dw_eu001[j]
										.statcode == "PS" || dw_eu001[j].statcode == "UW" || dw_eu001[j].statcode ==
										"MP" || dw_eu001[j].statcode == "PH" || dw_eu001[j].statcode == "PU" || dw_eu001[j]
										.statcode == "WV")) {
									for (let x = 0; x < ls_acctotallist.length; x++) {
										if (dw_eu001[j].crtable == ls_acctotallist[x]) {
											dwEu001[index] = dw_eu001[j];
											index++;
											break;
										}
									}
								}
							}
						}

						let li_roww = dwEu001.length;
						///获得本单本类型的保额
						let ld_total_sumins = 0;
						for (var j = 0; j < li_roww; j++) {
							let ld_sumins = 0
							ld_sumins = dwEu001[j].sumins;
							let ld_sumins_dang = dwEu001[j].suminsDang;
							let ld_cedprm = dwEu001[j].cedprm;
							let ls_statcode = dwEu001[j].statcode;
							let ls_acctype1 = dwEu001[j].acctype;
							//处理年金A款保额计算
							let ld_instprem = dwEu001[j].instprem;
							let ll_billfreq = Number(dwEu001[j].fupdesc);
							if (ll_billfreq == 0) {
								ll_billfreq = 1;
							}
							let ld_instprem_year = ll_billfreq * ld_instprem;
							let ld_danger = ld_sumins_dang * ld_cedprm;
							// if (ls_acctype1 == "01") {
							//   ld_sumins = this.fGetWpSumins(ll_billfreq, ld_sumins);
							// }
							ld_sumins = ld_sumins * ld_cedprm;
							let ls_crtable = dwEu001[j].crtable;

							if (ids_eula != null) {
								for (var x = 0; x < ids_eula.length; x++) {
									if (ids_eula[x].crtable == ls_crtable && ids_eula[x].acctype == ls_acctypeold) {
										idsEula[0] = ids_eula[x];
										break;
									}
								}
							}

							if (idsEula.length > 0) {
								let ld_percent = idsEula[0].percent01;
								if (idsEula[0].flag02 == "Y") {
									ld_percent = idsEula[0].percent02;
									ld_sumins = Number(ld_instprem_year) * Number(ld_percent);
								} else {
									ld_sumins = ld_sumins * ld_percent;
								}
							}
							ld_total_sumins = Number(ld_total_sumins) + Number(ld_sumins);
						}
						if (ls_unitind != "Y") {
							ld_total_sumins = Number(ld_total_sumins) / 10000;
						}

						let ld_curren_rate = Number(data.oppc);
						let li_cnt = 0;
						let params3 = {
							"uwlevel": that.curAddPremData.unipndPageList[0].is_Uwlevel,
							"acctype": ls_acctype,
							"ld_total_sumins": ld_total_sumins,
							"ld_curren_rate": ld_curren_rate
						}
						let url1 = appName.NEWUNDR + '/unipnd/premium/findEufupkyCount';
						let res1 = uwLoadJs.ajaxRequest(params3, url1);
						if (res1 == null) {
							return false;
						}
						if (res1.resultCode == constant.SUCCESS && res1.data != null) {
							li_cnt = res1.data;
						}


						if (li_cnt == 0) {
							that.popMsg("错误：2 OPPC加费数值超过权限" + ld_rate, 'error');
							data.oppc = 0;
							return false;
						}
					}
				}

				let id_sumin = 0;
				let ld_hsumin = 0;
				if (that.curAddPremObj.crtable == "UR02" || that.curAddPremObj.crtable == "URGT") {
					let params = {
						"asFunction": "SAPM",
						"alOccdate": that.curAddPremData.euaa.effdate + "",
						"asCrtable": that.curAddPremObj.crtable + "",
						"asSex": that.curAddPremObj.sex + "",
						"alAge": that.curAddPremObj.age + "",
						"alOppc": "0",
						"alSumin": that.curAddPremObj.sumins + "",
						"alInstprem": that.curAddPremObj.instprem + "",
						"asBillfreq": that.curAddPremData.euaa.billfreq + "",
						"adRatio": "0",
						"adHsumin": ld_hsumin + "",
						"adLsumin": "0",
						"asPmstatuz": "",
						"asSastatuz": "",
						"applnum": that.curAddPremObj.applnum + "",
					}
					let res = uwLoadJs.callEuis019(params);
					if (res == null) {
						return false;
					}
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						if (res.data != null) {
							id_sumin = res.data.alSumin;
							ld_hsumin = res.data.adHsumin;
						}
						if (id_sumin > ld_hsumin) {
							that.curAddPremObj.is_RULtimes = "B";
						} else {
							that.curAddPremObj.is_RULtimes = "L";
						}
					}
				}
			},
			//年期改变
			ext_cess_termChange(data) {
				if (isNaN(data.extCessTerm) == true) {
					data.extCessTerm = 0;
				}

				this.curAddPremData.is_calc = "Y";
				if (data.extCessTerm == null || data.extCessTerm == "" || Number(data.extCessTerm) == 0) {
					data.extCessTerm = this.curAddPremObj.premCessTerm;
					return false;
				} else {
					let premCessTerm = 0;
					let riskCessTerm = 0;
					if (this.curAddPremObj.prmsw == "A") {
						premCessTerm = Number(this.curAddPremObj.premCessTerm) - Number(this.curAddPremObj.age);
					} else {
						premCessTerm = this.curAddPremObj.premCessTerm
					}
					if (this.curAddPremObj.rsksw == "A") {
						riskCessTerm = Number(this.curAddPremObj.riskCessTerm) - Number(this.curAddPremObj.age);
					} else {
						riskCessTerm = this.curAddPremObj.riskCessTerm
					}
					if (Number(data.extCessTerm) > Number(premCessTerm)) {
						this.popMsg("错误:加费年期超过缴费年期", 'error');
						data.extCessTerm = premCessTerm;
						return false;
					}
				}
			},
			//定额加费改变
			insprmChange(data) {
				if (isNaN(data.insprm) == true) {
					data.insprm = 0;
				}

				this.curAddPremData.is_calc = "Y";
				if (this.curAddPremObj.cnttype == "SUL") {
					if (Number(data.insprm) != 1 && Number(data.insprm) != 2 && Number(data.insprm) != 3 &&
						Number(data.insprm) != 4 && Number(data.insprm) != 5) {
						this.popMsg("错误：" + this.curAddPremObj.polpln + "加费等级不存在", 'error');
						data.insprm = 0;
						return false;
					}
				} else {
					if (this.curAddPremObj.cnttype == "UR2" && Number(data.insprm) == 0) {
						this.curAddPremObj.is_RULTimes = "L";
					}
				}
			},
			//加费
			openPremium(pageData, data, sign, index) {
				let _that = this;

				//初始化加费
				let params3 = {
					"applnum": data.applnum,
					"chdrnum": data.chdrnum,
					"userId": pageData.unipndPageList[0].userId,
					"clntnum": data.clntnum,
					"polpln": data.polpln
				}
				let url = appName.NEWUNDR + '/unipnd/premium/showPremium';
				let res = uwLoadJs.ajaxRequest(params3, url);
				if (res == null) {
					return false;
				}
				let premiumTempVO = null;
				_that.curAddPremData = pageData;
				_that.curAddPremData.addSumins = 0;
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					_that.premiumTempList = res.data.premiumTempList;
					if (res.data.premiumTempVO) {
						premiumTempVO = res.data.premiumTempVO;
					}
					if (_that.premiumTempList) {
						_that.premiumTempList.forEach(item => {
							_that.curAddPremData.addSumins += Number(item.zlinstprem);
							let zmortpctBg = "B";
							let oppcBg = "B";
							let tmpCrtable = data.crtable.substr(0, 3);
							let crtable = data.crtable;
							if (data.statFund == "M") {
								if (pageData.euaa.appltype == "2") {
									zmortpctBg = "RF";
								} else {
									oppcBg = "RF"
								}
								//开放百分比加费

								if (_that.feeAddOPPCList && (_that.feeAddOPPCList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddOPPCList.indexOf(crtable) >= 0)) {
									zmortpctBg = "RF";
									oppcBg = "B"
								}
								//开放TM
								if (_that.feeAddTMList && (_that.feeAddTMList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddTMList.indexOf(crtable) >= 0)) {
									zmortpctBg = "B";
									oppcBg = "RF"
								}
								//两者均开放
								if (_that.feeAddTOList && (_that.feeAddTOList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddTOList.indexOf(crtable) >= 0)) {
									zmortpctBg = "B";
									oppcBg = "B"
								}
								//两者均不开放
								if (_that.feeAddNOList && (_that.feeAddNOList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddNOList.indexOf(crtable) >= 0)) {
									zmortpctBg = "RF";
									oppcBg = "RF"
								}
								//             if (data.crtable == "HLA4" || data.crtable == "HS0S") {
								//               zmortpctBg = "F";
								//               oppcBg = "B"
								//             }
								// /* 增加HLAY判断 */
								// if(data.crtable == "HLAY"){
								// 	zmortpctBg = "RF";
								// 	oppcBg = "B"
								// }
								// /* 增加HLBA判断，放开加费百分比和TM加费 */
								// if(data.crtable == "HLBA" ){
								// 	zmortpctBg = "B";
								// 	oppcBg = "B"
								// }
								// /* 增加SHRM判断，放开TM加费 */
								// if(data.crtable == "SHRM"){
								// 	zmortpctBg = "B";
								// 	oppcBg = "RF"
								// }
								/* 增加測試險種判断，放开百分比加费/TM加费 */
								// if(data.crtable =="HLAD"||data.crtable =="HLAE"||
								// 	data.crtable =="HLAG" || data.crtable =="HLAF"){
								// 	zmortpctBg = "B";
								// 	oppcBg = "B"
								// }

							} else if (data.statFund == "R") {
								if (uwJs.judgeIsSpecCrtable("INVEST_UNIVERSAL_ALL_CRTABLES", data
									.polpln)) //如果不是投连和万能险种
								{
									oppcBg = "RF"
								} else {
									zmortpctBg = "RF";
								}
								//开放百分比加费
								if (_that.feeAddOPPCList && (_that.feeAddOPPCList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddOPPCList.indexOf(crtable) >= 0)) {
									zmortpctBg = "RF";
									oppcBg = "B"
								}
								//开放TM
								if (_that.feeAddTMList && (_that.feeAddTMList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddTMList.indexOf(crtable) >= 0)) {
									zmortpctBg = "B";
									oppcBg = "RF"
								}
								//两者均开放
								if (_that.feeAddTOList && (_that.feeAddTOList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddTOList.indexOf(crtable) >= 0)) {
									zmortpctBg = "B";
									oppcBg = "B"
								} //两者均不开放
								if (_that.feeAddNOList && (_that.feeAddNOList.indexOf(tmpCrtable) >= 0 || _that
										.feeAddNOList.indexOf(crtable) >= 0)) {
									zmortpctBg = "RF";
									oppcBg = "RF"
								}
							}

							item['zmortpctBg'] = zmortpctBg;
							item['oppcBg'] = oppcBg;
							item['checked'] = false;

						})
					}
				}

				if (premiumTempVO != null) {
          var lt_time = uwJs.showTime();
          var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
					_that.premiumTempVO = res.data.premiumTempVO;
					_that.premiumTempVO['surname'] = data.as_surname;
					_that.premiumTempVO['polpln'] = data.polpln;
          _that.premiumTempVO['dtecrt'] = pageData.unipndPageList[0].lda_date;
          _that.premiumTempVO['crttime'] = ll_time1;

				} else {
					var lt_time = uwJs.showTime();
					var ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
					_that.premiumTempVO['noteitem'] = "02";
					_that.premiumTempVO['applnum'] = data.applnum;
					_that.premiumTempVO['chdrnum'] = data.chdrnum;
					_that.premiumTempVO['clntnum'] = data.clntnum;
					_that.premiumTempVO['notecode'] = data.notecode;
					_that.premiumTempVO['notedesc'] = data.notecode;
					_that.premiumTempVO['crtuser'] = pageData.unipndPageList[0].userId;
					_that.premiumTempVO['dtecrt'] = pageData.unipndPageList[0].lda_date;
					_that.premiumTempVO['crttime'] = ll_time1;
					_that.premiumTempVO['userProfile'] = pageData.unipndPageList[0].userId;
					_that.premiumTempVO['jobName'] = uwconstant.jobName;
					_that.premiumTempVO['datime'] = _that.initTime();
					_that.premiumTempVO['crtable'] = data.crtable;
					_that.premiumTempVO['premCessTerm'] = data.premCessTerm;
					_that.premiumTempVO['surname'] = data.as_surname;
					_that.premiumTempVO['polpln'] = data.polpln;

				}

				console.log(_that.premiumTempVO);

				if (pageData.unipndPageList[0].is_option == "DSP") {
					_that.isPremiumCalc = true;
					_that.isPremiumAdd = true;
					_that.isPremiumDel = true;
				}

				if (data.polpln.indexOf("PHA") == -1) {
					_that.isHiTr = true;
					_that.isPrtTr = true;
				}

				if (data.crtable == "WPB4") {
					_that.specialPre = false;
				}

				_that.curAddPremData.addSumins = _that.curAddPremData.addSumins.toFixed(2);
				_that.curAddPremData['is_dangflag'] = "N";
				_that.curAddPremData['is_indexflag'] = "N";
				//_that.curAddPremData['gs_rimsg'] = "0";
				_that.curAddPremData['is_upd'] = "N";
				_that.curAddPremObj = data;
				_that.curAddPremData['is_RULtimes'] = "N";
				_that.curAddPremData['is_calc'] = "N";
				if (sign == "c") {
					_that.opinionDialogVisible14 = true;
				}
				if (index == 1) {
					//调用之前缓存一下可能存在的加费情况
					if (this.premiumTempList.length > 0) {
						let temp = this.deepClone(this.premiumTempList);
						this.curAddPremObj['premList'] = temp;
					} else {
						this.curAddPremObj['premList'] = [];
					}
				}
				if (pageData.euaa.approval != "") {
					this.isRead = true;
				} else {
					if (!this.isApprovalDisabled && !pageData.allInfoReadOnly) {
						this.isRead = false;
					} else {
						this.isRead = true;
					}
				}

			},
			isArray(arr) {
				return Object.prototype.toString.call(arr) === '[object Array]';
			},
			// 深度克隆
			deepClone(obj) {
				if (typeof obj !== "object" && typeof obj !== 'function') {
					return obj; //原始类型直接返回
				}
				var o = this.isArray(obj) ? [] : {};
				for (var i in obj) {
					if (obj.hasOwnProperty(i)) {
						o[i] = typeof obj[i] === "object" ? this.deepClone(obj[i]) : obj[i];
					}
				}
				return o;
			},
			fGetTotallist(as_acctype) {
				let crtableList = null;
				let ls_totallist = "";
				let that = this;

				let params = {
					"acctype": as_acctype
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/findCrtableByAcctype';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					crtableList = res.data;
				}

				if (crtableList != null) {
					for (let i = 0; i < crtableList.length; i++) {
						if (ls_totallist.length > 0) {
							ls_totallist = ls_totallist + ",";
						}
						ls_totallist = ls_totallist + crtableList[i].crtable.toUpperCase();
					}
				}

				return ls_totallist;
			},

			fGetWpSumins(ll_billfreq, ld_sumins) {
				var ld_suminsTemp = 0;
				if (Number(ll_billfreq) == 0) {
					ld_suminsTemp = ld_sumins;
				} else {
					ld_suminsTemp = ld_sumins * ll_billfreq;
				}
				return ld_suminsTemp;
			},

			fGetRateupRate(as_crtable, as_userid) {
				var json;
				let ls_crtable = "";
				let ls_acctype = null;
				let ls_uwlevel = "";
				let li_cnt = 0;
				let ld_rateup = 0;
				let that = this;

				let params1 = {
					"crtable": as_crtable
				}
				let url = appName.NEWUNDR + '/unipnd/premium/findEulapfCount';
				let res = uwLoadJs.ajaxRequest(params1, url);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					li_cnt = res.data;
				}
				if (li_cnt > 1) {
					return -1;
				}

				let url1 = appName.NEWUNDR + '/unipnd/premium/findAcctypeByCrtable';
				let res1 = uwLoadJs.ajaxRequest(params1, url1);
				if (res1 == null) {
					return false;
				}
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					ls_acctype = res1.data;
				}

				if (ls_acctype == null) {
					return -1;
				}

				let params2 = {
					"uwlevel": this.curAddPremData.unipndPageList[0].is_Uwlevel,
					"acctype": ls_acctype
				}
				let res2 = uwLoadJs.findAgcomrtByUwlevel(params2);
				if (res2 == null) {
					return false;
				}
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					ld_rateup = res2.data.AGCOMRT;
				} else {
					ld_rateup = -1;
				}
				if (ld_rateup == -1) {
					return -1;
				}

				return ld_rateup;
			},

			//返回
			premBack() {
				let mark = "N";
				//如果计算完加费后没有做任何操作，弹框被关闭了，则移除缓存中该条险种加费记录
				if (this.curAddPremObj['isTryAdd'] == 'Y') {
					mark = 'Y';
					//还原之前的加费情况
					if (this.curAddPremObj['premList'].length > 0) {
						this.premiumTempList.forEach(euah => {
							this.curAddPremObj['premList'].forEach(temp => {
								//将该核保员名下的该加费信息还原成计算前时候值
								if (euah.polpln == temp.polpln && euah.remark02 == temp.remark02) {
									if (!euah['isDeal'] && euah['isDeal'] != 'Y') {
										euah['isDeal'] = 'N';
									}
									if (euah.seqnbr == temp.seqnbr) {
										let params1 = {
											"applnum": temp.applnum,
											"chdrnum": temp.chdrnum,
											"clntnum": temp.clntnum,
											"polpln": temp.polpln,
											"seqnbr": temp.seqnbr,
											"remark02": temp.remark02,
											"zlinstprem": temp.zlinstprem, //次标加费,
											"opcda": temp.opcda, //
											"extCessTerm": temp.extCessTerm, //
											"insprm": temp.insprm, //
											"oppc": temp.oppc,
											"zmortpct": temp.zmortpct //
										}
										let url2 = appName.NEWUNDR +
											'/unipnd/premium/updatePremiumTempWithCalc1';
										let res2 = uwLoadJs.ajaxRequest(params1, url2);
										euah['isDeal'] = 'Y';
									}
								}
							})
						})
						this.premiumTempList.forEach(eu => {
							//如果该核保员还执行了新增的其他加费，则删除掉
							if (eu.isDeal == 'N' && eu.remark02 == this.userId) {
								let params1 = {
									"applnum": eu.applnum,
									"chdrnum": eu.chdrnum,
									"clntnum": eu.clntnum,
									"polpln": eu.polpln,
									"seqnbr": eu.seqnbr,
									"remark02": eu.remark02,
								}
								let url2 = appName.NEWUNDR + '/unipnd/premium/deletePremiumTempWithCalc';
								let res2 = uwLoadJs.ajaxRequest(params1, url2);
								eu.isDeal == '';
							}
						});
					}
					this.curAddPremObj['isTryAdd'] = 'N'
					this.curAddPremObj['premList'] = [];
					this.callPremBase = null;
					this.callPremEuabs = [];
					this.callPremEuahs = [];
				}
				let euabs = [];
				this.curAddPremData.trailer4.forEach(item => {
					if (this.curAddPremObj.crtable == item.crtable) {
						console.log("记录核保结论:" + item.approval);
						item.approval = item.oldapproval;
						// item.approval = "";
						//绑定之前的结论，为了选择标准体的时候清除加费信息
						item.oldapproval = "A";
						if (this.premiumTempList.length > 0) {
							let total = 0;
							this.premiumTempList.forEach(euah => {
								if (euah.polpln == this.curAddPremObj.polpln && euah.remark02 == this
									.userId) {
									total += Number(euah.zlinstprem);
								}
							})
							if (total == 0 && item.approval == 'A' && item.isUWFlag == "0") {
								item.approval = "";
								this.popMsg("错误信息!!加费金额为0,请重新选择该险种的险种核保结论", 'error')
							}
							if (total == 0 && mark == 'Y' && item.isUWFlag == "0") {
								item.approval = "";
							}
						} else {
							item.approval = "";
						}
					}
					euabs.push(item);
				})
				this.curAddPremData.trailer4 = euabs;
				let datas = [];
				this.pageData.forEach(item => {
					if (item.curApplnum == this.curAddPremData.curApplnum) {
						datas.push(this.curAddPremData);
					} else {
						datas.push(item);
					}
				})

				this.pageData = datas;
				this.initPolicyConclusions(this.curAddPremData);
				this.opinionDialogVisible14 = false;
			},
			//确定加费
			addPremSure(type) {
				let isNext = true;
				//拦截
				this.curAddPremData.trailer4.forEach(item => {
					if (this.curAddPremObj.polpln == item.polpln) {
						if (this.premiumTempList.length > 0) {
							let total = 0;
							this.premiumTempList.forEach(euah => {
								if (euah.remark02 == this.userId) {
									total += Number(euah.zlinstprem);
								}
							})
							if (total == 0 && (item.approval == 'A' || item.approval == 'B') && item.isUWFlag ==
								"0") {
								item.approval = "";
								this.popMsg("错误信息!!加费金额为0,请重新选择该险种的险种核保结论", 'error')
								isNext = false;
							}
						} else {
							item.approval = "";
						}
					}
				})
				if (!isNext) {
					// this.apLoading = false;
					// this.ppFlag = false;
					// this.opinionDialogVisible14 = false;
					this.setData(_that.curAddPremData);
					return false;
				}
				this.setAddPrem();

				this.apLoading = true;
				this.pageModifyFlag = true;
				let _that = this;
				let ld_ratio = 0,
					ld_hsumin = 0,
					ld_lsumin = 0,
					ld_oppceu019 = 0,
					id_sumin = 0;
				let ls_pmsts = "",
					ls_sasts = "";


				this.addPremSureTimeOut = setTimeout(function() {
					console.log("1.确定加费校验");
					let checkStu = _that.wfRateupCheck("exit", _that.curAddPremObj);
					if (checkStu != 0) {
						if (checkStu == 2) {
							if (type == "1") {
								if (_that.premiumTempList && _that.premiumTempList.length == 0) {
									_that.curAddPremObj.approval = "";
								}
							}
							_that.setData(_that.curAddPremObj);
							_that.changeApproval(_that.curAddPremData);
							_that.submitPremium();
							_that.opinionDialogVisible14 = false;
						}
						_that.apLoading = false;
						return false;
					} else {
						console.log("2.确定加费保存加费");
						_that.submitPremium();
						if (!_that.wfC01Setting("C01")) {
							_that.apLoading = false;
							return false;
						}


						let ls_pncode = null;
						let params = {
							"crtable": _that.curAddPremObj.crtable
						}
						let url1 = appName.NEWUNDR + '/unipnd/premium/findPncodeByCrtable';
						let res1 = uwLoadJs.ajaxRequest(params, url1);
						if (res1 == null) {
							return false;
						}
						if (res1.resultCode == constant.SUCCESS && res1.data != null) {
							ls_pncode = res1.data.trim();
						}
						console.log("3.确定加费险种" + _that.curAddPremObj.crtable + "查询照会" + ls_pncode);
						if (ls_pncode == null || ls_pncode == "") {
							// _that.$message({
							//   message: "讯息：照会代码 (" + ls_pncode + ") 读取错误",
							//   type: 'error'
							// });
							// _that.apLoading = false;
							// return false;
						} else {
							if (!_that.wfC01Setting(ls_pncode)) {
								_that.apLoading = false;
								return false;
							}
						}

						if (uwJs.judgeIsSpecCrtable('CAL_HISUMINS_CRTABLES', _that.curAddPremObj.crtable)) {
							let ll_zmortpct = 0;
							if (_that.premiumTempList.length > 0) {
								ll_zmortpct = _that.premiumTempList[0].zmortpct;
							}
							ll_zmortpct = ll_zmortpct - 100;
							if (ll_zmortpct < 0) {
								ll_zmortpct = 0;
							}

							let params2 = {
								"asFunction": "SAPM",
								"alOccdate": _that.curAddPremData.euaa.effdate + "",
								"asCrtable": _that.curAddPremObj.crtable + "",
								"asSex": _that.curAddPremObj.sex + "",
								"alAge": _that.curAddPremObj.age + "",
								"alOppc": ll_zmortpct + "",
								"alSumin": _that.curAddPremObj.sumins + "",
								"alInstprem": _that.curAddPremObj.instprem + "",
								"asBillfreq": _that.curAddPremData.euaa.billfreq + "",
								"adRatio": ld_ratio + "",
								"adHsumin": ld_hsumin + "",
								"adLsumin": ld_lsumin + "",
								"asPmstatuz": "",
								"asSastatuz": "",
								"applnum": _that.curAddPremObj.applnum,
							}
							let url1 = appName.NEWUNDR + '/unipnd/premium/callEuis019';
							let res = uwLoadJs.ajaxRequest(params2, url1);
							if (res == null) {
								return false;
							}
							if (res.resultCode == constant.SUCCESS && res.data != null) {
								ls_sasts = res.data.asSastatuz;
								ld_hsumin = res.data.adHsumin;
								id_sumin = res.data.alSumin;
							}

							if (ls_sasts == "ENDP") {
								_that.popMsg("错误信息!!无此加费倍数/或取数据异常,请检查!!!!", 'error');
								_that.apLoading = false;
								return false;
							}
							if (id_sumin > ld_hsumin) {
								_that.curAddPremObj.is_RULtimes = "B";
							} else {
								_that.curAddPremObj.is_RULtimes = "L";
							}

							if (ld_hsumin > 0) {
								let cdata = [];
								_that.curAddPremData.trailer4.forEach(item => {
									if (item.crtable == _that.curAddPremObj.crtable) {
										item.maxsumin = ld_hsumin;
										item.maxsuminTd = ld_hsumin;
										if (_that.curAddPremObj.crtable == "UR02" || _that.curAddPremObj
											.crtable == "UR03" || _that.curAddPremObj.crtable == "UR04" ||
											_that.curAddPremObj.crtable == "SUV1" || _that.curAddPremObj
											.crtable == "SUR2" || _that.curAddPremObj.crtable == "URB1" ||
											_that.curAddPremObj.crtable == "URB2" || _that.curAddPremObj
											.crtable == "URB3" || _that.curAddPremObj.crtable == "URB4" ||
											_that.curAddPremObj.crtable == "IM0A" || _that.curAddPremObj
											.crtable == "IM0B" || _that.curAddPremObj.crtable == "IM0C" ||
											_that.curAddPremObj.crtable == "UR04" || _that.curAddPremObj
											.crtable == "UR05"
										) {} else {
											_that.wfSetUr02("C85");
										}
									}
									cdata.push(item);
								})
								_that.curAddPremData.trailer4 = cdata;
								_that.setData(_that.curAddPremData);
							}
						}

					}

					//加费列表为空清空结论
					if (type == "1") {
						if (_that.premiumTempList && _that.premiumTempList.length == 0) {
							_that.curAddPremObj.approval = "";
						}
					}


					//记录核保结论
					let euabs = [];
					_that.curAddPremData.trailer4.forEach(item => {
						if (_that.curAddPremObj.crtable == item.crtable) {
							console.log("记录核保结论:" + item.approval);
							item['oldapproval'] = item.approval;
						}
						euabs.push(item);
					})
					_that.curAddPremData.trailer4 = euabs;
					let datas = [];
					_that.pageData.forEach(item => {
						if (item.curApplnum == _that.curAddPremData.curApplnum) {
							datas.push(_that.curAddPremData);
						} else {
							datas.push(item);
						}
					})

					_that.pageData = datas;
					_that.changeApproval(_that.curAddPremData);
					_that.apLoading = false;
					_that.opinionDialogVisible14 = false;
					return true;
				}, 100);


			},
			wfSetUr02(as_type) {
				let that = this;
				let params1 = {
					"applnum": this.curAddPremData.curApplnum,
					"userId": this.curAddPremData.unipndPageList[0].userId
				}

				let premiumCount = 0;
				let url = appName.NEWUNDR + '/unipnd/premium/findEutcpfCountIsExist';
				let res2 = uwLoadJs.ajaxRequest(params1, url);
				if (res2 == null) {
					return false;
				}
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					premiumCount = res2.data;
				}

				if (premiumCount <= 0) {
					this.curAddPremData.eubas.forEach(euba => {
						if (euba.pncode == as_type) {
							euba.procflg = "S";
							euba.dateend = this.curAddPremData.unipndPageList[0].lda_date;
							euba.as_dateend = this.curAddPremData.unipndPageList[0].lda_date;
						}
					})

					this.curAddPremData.is_upd = "N";
					let datas = [];
					this.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							data = this.curAddPremData;
						}
						datas.push(data);
					})
					this.pageData = datas;
					return false;
				}

				this.curAddPremData.eubas.forEach(euba => {
					if (euba.pncode == as_type) {
						if (this.curAddPremObj.is_RULtimes == "L") {
							euba.procflg = "S";
							euba.dateend = this.curAddPremData.unipndPageList[0].lda_date;
							euba.as_dateend = this.curAddPremData.unipndPageList[0].lda_date;
						} else {
							euba.pndate = this.curAddPremData.unipndPageList[0].lda_date;
							euba.as_pndate = this.curAddPremData.unipndPageList[0].lda_date;
							euba.procflg = "";
							euba.dateend = "0";
							euba.as_dateend = "0";
						}
						this.curAddPremData.is_upd = "N";
						let datas = [];
						this.pageData.forEach(data => {
							if (data.curApplnum == this.curAddPremData.curApplnum) {
								data = this.curAddPremData;
							}
							datas.push(data);
						})
						this.pageData = datas;
						return false;
					}
				});

				let params2 = {
					"pncode": as_type
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}

				if (lds_pn == null) {
					this.popMsg("讯息：照会代码 (" + as_type + ") 读取错误", 'error');
					this.curAddPremData.is_upd = "N";
					let datas = [];
					this.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							data = this.curAddPremData;
						}
						datas.push(data);
					})
					this.pageData = datas;
					return false;
				}

				let params3 = {
					"ls_date": this.curAddPremData.unipndPageList[0].lda_date,
					"ll_remindday": lds_pn.remindday + ""
				}
				let lda_reminddate = "0";
				let res1 = uwLoadJs.deteRoll(params3);
				if (res1 == null) {
					return false;
				}
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					lda_reminddate = res1.data;
				}

				let index = this.curAddPremData.eubas.length;
				let memodesc = this.curAddPremData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "10") {
					memodesc = "$$$$$" + uwJs.showTime().substring(2);
				}
				let pntype = this.getPntype(lds_pn.zresnpd);
				let euba = {
					pntype: pntype,
					applnum: this.curAddPremData.curApplnum,
					zresnpd: lds_pn.zresnpd,
					chdrnum: this.curAddPremObj.chdrnum,
					memodesc: memodesc,
					pndate: this.curAddPremData.unipndPageList[0].lda_date,
					dateend: "0",
					forceind: lds_pn.forceind,
					resind: lds_pn.resind,
					prtopt: lds_pn.prtopt,
					zprtcert: lds_pn.authnow,
					reminddate: lda_reminddate,
					remindflg: "N",
					crtuser: "",
					dtecrt: "0",
					crttime: "0",
					nofday: lds_pn.nofday,
					source: lds_pn.source,
					jobName: uwconstant.jobName,
					userProfile: "",
					datime: this.initTime(),
					as_hand: this.curAddPremData.eufgpkyVO.forceind,
					clntnum: "",
					pncode: as_type,
					procflg: "",
					pedesc: lds_pn.pedesc,
					as_pndate: this.curAddPremData.unipndPageList[0].lda_date,
					rprntdate: "0",
					userid: "",
					pnfrom: this.curAddPremData.unipndPageList[0].userId,
					as_dateend: "0",
					pncodeBg: "B",
					pedescBg: "B",
					clntnumSelectBg: "B",
					num: index
				}
				// this.curAddPremData.eubas.push(euba);
				this.curAddPremData.is_upd = "N";
				this.refreshEubas(this.curAddPremData, euba);
				let datas = [];
				this.pageData.forEach(data => {
					if (data.curApplnum == this.curAddPremData.curApplnum) {
						data = this.curAddPremData;
					}
					datas.push(data);
				})
				this.pageData = datas;
				return false;

			},
			//加费
			wfC01Setting(as_type) {
				let premiumCount = 0;
				let li_find = 0;
				let ls_sasts = "";
				let ls_pndesc = null;
				let ll_remindday = 0;
				let ld_addfee = 0;
				let ls_addfee = 0;
				let that = this;

				//判断有没有加费记录
				let params1 = {
					"applnum": this.curAddPremData.curApplnum,
					"userId": this.curAddPremData.unipndPageList[0].userId
				}
				let url1 = appName.NEWUNDR + '/unipnd/premium/findEutcpfCountIsExist';
				let res2 = uwLoadJs.ajaxRequest(params1, url1);
				if (res2 == null) {
					return false;
				}
				if (res2.resultCode == constant.SUCCESS && res2.data != null) {
					premiumCount = res2.data;
				}

				if (premiumCount <= 0) {
					let eubas = [];
					that.curAddPremData.eubas.forEach(euba => {
						if (euba.pntype == "1") {
							if (euba.pncode == as_type && Number(euba.rprntdate) == 0) {
								if (as_type == "R20") {
									let params2 = {
										"asFunction": "SAPM",
										"alOccdate": that.curAddPremData.euaa.effdate + "",
										"asCrtable": that.curAddPremObj.crtable + "",
										"asSex": that.curAddPremObj.sex + "",
										"alAge": that.curAddPremObj.age + "",
										"alOppc": "0",
										"alSumin": that.curAddPremObj.sumins + "",
										"alInstprem": that.curAddPremObj.instprem + "",
										"asBillfreq": that.curAddPremData.euaa.billfreq + "",
										"adRatio": "0",
										"adHsumin": "0",
										"adLsumin": "0",
										"asPmstatuz": "",
										"asSastatuz": "",
										"applnum": that.curAddPremObj.applnum,
									}
									let url1 = appName.NEWUNDR + '/unipnd/premium/callEuis019';
									let res2 = uwLoadJs.ajaxRequest(params2, url1);
									if (res2 == null) {
										return false;
									}
									if (res2.resultCode == constant.SUCCESS && res2.data != null) {
										ls_sasts = res2.data.asSastatuz;
									}
									if (ls_sasts == "") {
										euba.procflg = "S";
										euba.dateend = that.curAddPremData.unipndPageList[0].lda_date;
										euba.as_dateend = that.curAddPremData.unipndPageList[0].lda_date;
									}
									eubas.push(euba);
								} else {
									//删除
								}
							} else {
								eubas.push(euba);
							}
						} else {
							eubas.push(euba);
						}
					})
					that.curAddPremData.eubas = eubas;

					that.curAddPremData.is_upd = "N";
					let datas = [];
					that.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							data = this.curAddPremData;
						}
						datas.push(data);
					})
					that.pageData = datas;
					return false;
				}

				let eubaData = null;
				that.curAddPremData.eubas.forEach(euba => {
					if (euba.pncode == as_type && euba.rprntdate == 0) {
						eubaData = euba;
					}
				})
				if (eubaData != null) {
					if (that.curAddPremData.is_RULtimes == "Y" && as_type == "R20") {
						eubaData.procflg = "S";
						eubaData.dateend = this.curAddPremData.unipndPageList[0].lda_date;
						eubaData.as_dateend = this.curAddPremData.unipndPageList[0].lda_date;
					} else {
						let params2 = {
							"pncode": as_type
						}
						let lds_pn = null;
						let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
						if (res == null) {
							return false;
						}
						if (res.resultCode == constant.SUCCESS && res.data != null) {
							lds_pn = res.data;
						}
						if (lds_pn == null) {
							this.popMsg("讯息：照会代码 (" + as_type + ") 读取错误", 'error');
						}

						if (as_type == "C01") {
							ls_pndesc = lds_pn.pedesc;
							ll_remindday = lds_pn.remindday;

							if (ls_pndesc.indexOf("###") >= 0) {
								ld_addfee = Number(this.curAddPremData.euaa.as_instprem).toFixed(2);
								ls_addfee = ld_addfee;
								ls_pndesc = ls_pndesc.replace("###", ls_addfee);
							}
						} else {
							ls_pndesc = lds_pn.pedesc;
							ll_remindday = lds_pn.remindday;

							that.curAddPremData.trailer4.forEach(item => {
								if (item.crtable == this.curAddPremObj.crtable) {
									if (ls_pndesc.indexOf("@@@") >= 0) {
										ld_addfee = Number(item.zlinstprem);
										ls_addfee = item.zlinstprem;
										ls_pndesc = ls_pndesc.replace("@@@", ls_addfee);
									}
								}
							})
						}

						//修改结案日期及处理码
						eubaData.pedesc = ls_pndesc;
						eubaData.pndate = this.curAddPremData.unipndPageList[0].lda_date;
						eubaData.as_pndate = this.curAddPremData.unipndPageList[0].lda_date;
						eubaData.procflg = "";
						eubaData.dateend = "0";
						eubaData.as_dateend = "0";

						//add remindday.
						let params3 = {
							"ls_date": this.curAddPremData.unipndPageList[0].lda_date,
							"ll_remindday": lds_pn.remindday + ""
						}
						let lda_reminddate = "0";
						let res1 = uwLoadJs.deteRoll(params3);
						if (res1 == null) {
							return false;
						}
						if (res1.resultCode == constant.SUCCESS && res1.data != null) {
							lda_reminddate = res1.data;
						}
						eubaData.reminddate = Number(lda_reminddate);
						eubaData.remindflg = "N";
						eubaData.rprntdate = "0";
						eubaData.as_hand = this.curAddPremData.eufgpkyVO.forceind;

						let newEuba = [];
						let tempEuba = null;
						that.curAddPremData.eubas.forEach(euba => {
							if (euba.pncode == as_type && euba.rprntdate == 0 && tempEuba == null && euba
								.procflg == "") {
								euba = eubaData;
								tempEuba = euba;
							}
							newEuba.push(euba);
						})
						that.curAddPremData.eubas = newEuba;
					}
					that.curAddPremData.is_upd = "N";
					let datas = [];
					that.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							data = this.curAddPremData;
						}
						datas.push(data);
					})
					that.pageData = datas;
					return true;
				}



				if (this.curAddPremData.is_RULtimes == "Y" && as_type == "R20") {
					this.curAddPremData.is_upd = "N";
					let datas = [];
					this.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							data = this.curAddPremData;
						}
						datas.push(data);
					})
					this.pageData = datas;
					return false;
				}

				let params2 = {
					"pncode": as_type
				}
				let lds_pn = null;
				let res = uwLoadJs.checkPncodeAndZresnpdFromEufapky(params2);
				if (res == null) {
					return false;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					lds_pn = res.data;
				}

				if (lds_pn == null) {
					this.popMsg("讯息：照会代码 (" + as_type + ") 读取错误", 'error');
					return false;
				}

				ls_pndesc = lds_pn.pedesc;

				let params3 = {
					"ls_date": this.curAddPremData.unipndPageList[0].lda_date,
					"ll_remindday": lds_pn.remindday + ""
				}
				let lda_reminddate = "0";
				let res1 = uwLoadJs.deteRoll(params3);
				if (res1 == null) {
					return false;
				}
				if (res1.resultCode == constant.SUCCESS && res1.data != null) {
					lda_reminddate = res1.data;
				}

				let ld_addfee1 = 0;
				if (as_type != "C01") {
					let li_findcrtable = null;
					this.curAddPremData.trailer4.forEach(item => {
						if (item.crtable == this.curAddPremObj.crtable) {
							if (ls_pndesc.indexOf("@@@") >= 0) {
								ld_addfee = Number(item.zlinstprem);
								ls_addfee = item.zlinstprem;
								ls_pndesc = ls_pndesc.replace("@@@", ls_addfee);
							}
						}
					})

				} else {
					if (ls_pndesc.indexOf("###") >= 0) {
						ld_addfee = Number(this.curAddPremData.euaa.as_instprem).toFixed(2);
						ls_addfee = ld_addfee;
						ls_pndesc = ls_pndesc.replace("###", ls_addfee);
					}
					if (as_type != "C01") {
						if (ls_pndesc.indexOf("@@@") >= 0) {
							ld_addfee1 = Number(this.curAddPremData.euaa.as_payment);
							if (ld_addfee >= ld_addfee1) {
								ls_addfee = ld_addfee - ld_addfee1;
								ls_pndesc = ls_pndesc.replace("@@@", "请补缴保费" + ls_addfee);
							} else {
								ls_addfee = ld_addfee1 - ld_addfee;
								ls_pndesc = ls_pndesc.replace("@@@", "溢缴保费" + ls_addfee);
							}
						}
					}
				}

				let memodesc = this.curAddPremData.euaa.tsalesunt + uwJs.showTime().substring(2);
				if (lds_pn.zresnpd == "10") {
					memodesc = "$$$$$" + uwJs.showTime().substring(2);
				}

				let euba = {
					applnum: this.curAddPremData.curApplnum,
					zresnpd: lds_pn.zresnpd,
					pntype: "1",
					chdrnum: this.curAddPremObj.chdrnum,
					memodesc: memodesc,
					pndate: this.curAddPremData.unipndPageList[0].lda_date,
					dateend: "0",
					forceind: lds_pn.forceind,
					resind: lds_pn.resind,
					prtopt: lds_pn.prtopt,
					zprtcert: lds_pn.authnow,
					reminddate: Number(lda_reminddate),
					remindflg: "N",
					crtuser: "",
					dtecrt: "0",
					crttime: "0",
					nofday: lds_pn.nofday,
					source: lds_pn.source,
					jobName: uwconstant.jobName,
					userProfile: "",
					datime: this.initTime(),
					as_hand: this.curAddPremData.eufgpkyVO.forceind,
					clntnum: this.curAddPremObj.clntnum,
					pncode: as_type,
					procflg: "",
					pedesc: ls_pndesc,
					as_pndate: this.curAddPremData.unipndPageList[0].lda_date,
					rprntdate: "0",
					userid: "",
					pnfrom: this.curAddPremData.unipndPageList[0].userId,
					as_dateend: "0",
					pncodeBg: "B",
					pedescBg: "B",
					clntnumSelectBg: "B",
					num: this.curAddPremData.eubas.length
				}
				this.curAddPremData.is_upd = "N";
				// this.curAddPremData.eubas.push(euba);
				this.refreshEubas(this.curAddPremData, euba);
				let datas = [];
				this.pageData.forEach(data => {
					if (data.curApplnum == this.curAddPremData.curApplnum) {
						data = this.curAddPremData;
					}
					datas.push(data);
				})
				this.pageData = datas;
				return true;
			},
			//保存加费
			submitPremium() {
				let that = this;
				let params = {
					"applnum": this.curAddPremObj.applnum,
					"userId": this.curAddPremData.unipndPageList[0].userId,
					"chdrnum": this.curAddPremObj.chdrnum,
					"clntnum": this.curAddPremObj.clntnum,
					"polpln": this.curAddPremObj.polpln,
					"crtable": this.curAddPremObj.crtable,
					"premiumTempList": JSON.stringify(this.premiumTempList),
					"eutc": JSON.stringify(this.premiumTempVO),
				}
				let url = appName.NEWUNDR + '/unipnd/premium/savePremium';
				let res2 = uwLoadJs.ajaxRequest(params, url);

			},
			//加费试算 1,加费 2.加费除外
			calcClick(rate, type) {
				let that = this;
				this.pageModifyFlag = true;
				this.apLoading = true;

				this.calcClickTimeOut = setTimeout(function() {
					debugger;
					console.log("1加费试算前保存数据");
					that.submitPremium();
					console.log("2加费试算前校验数据");
					if (that.wfRateupCheck() == 1) {
						that.apLoading = false;
						return false;
					} else {
						// if (that.curAddPremData.is_calc == "Y") {
						console.log("3加费试算前校验再保");
						if (that.wfCheckShareinX(that.curAddPremObj.crtable, 2, 1, that.curAddPremObj.polpln) ==
							0) {
							that.popMsg("再保提示：此险种符合分保要求，请先输入有效的再保意见!", 'error');
							that.apLoading = false;
							return false;
						}
						// console.log("4加费试算前更新加费");
						// that.submitPremium();//更新加费
						console.log("5加费试算");
						if (type == 1) {
							if (!that.wfCalcPrem(that.curAddPremData, "c", type, rate, that.flag03)) {
								that.apLoading = false;
								return false;
							} else {
								console.log("6计算成功重新加载加费信息");
								that.openPremium(that.curAddPremData, that.curAddPremObj);
							}
						} else if (type == 2) {
							if (!that.wfCalcPrem(that.curAddPremData, "s", type, rate, that.flag03)) {
								that.apLoading = false;
								return false;
							} else {
								console.log("6计算成功重新加载加费信息");
								that.openPPDioag(that.curAddPremData, that.curAddPremObj);
							}
						}

						//总加费金额
						let allZlinstprem = 0;
						that.premiumTempList.forEach(item => {
							allZlinstprem += Number(item.zlinstprem);
						})
						that.curAddPremData.addSumins = allZlinstprem.toFixed(2);

						//每期应缴保费
						let trailer4Zbinstprem = 0;
						let trailer4Zlinstprem = 0;
						that.curAddPremData.trailer4.forEach(item => {
							trailer4Zbinstprem += Number(item.zbinstprem);
							trailer4Zlinstprem += Number(item.Zlinstprem);
						})
						let allTrailer4ZbZl = Number(trailer4Zbinstprem + trailer4Zlinstprem).toFixed(2)

						that.curAddPremData.is_calc == "N"

					}

					that.apLoading = false;
				}, 100);

			},
			//分保校验
			wfCheckShareinX(crtable, ai_an2, ai_an3, polpln) {
				let that = this;
				let li_return = 1
				if (ai_an2 == 1) {
					li_return = wfCheckShareinX1(crtable, ai_an3, crtable, polpln);
				} else {
					let params = {
						"crtable": crtable
					}
					let sppbs = null;
					let url = appName.NEWUNDR + '/unipnd/nucleusNote/findAcctypeFromSppb';
					let res2 = uwLoadJs.ajaxRequest(params, url);
					if (res2 == null) {
						return false;
					}
					if (res2.resultCode == constant.SUCCESS && res2.data != null) {
						sppbs = res2.data;
					}
					if (sppbs && sppbs.length > 0) {
						let ls_acctype = sppbs[0].acctype;
						li_return = this.wfCheckShareinX1(ls_acctype, ai_an3, crtable, polpln);
					}
				}

				return li_return;
			},
			wfCheckShareinX1(ls_acctype, ai_an3, crtable, polpln) {
				let _that = this;
				let is_basic_id = "";
				let is_clntnum_id = "";
				this.curAddPremData.headClntnumList.forEach(item => {
					if (item.roleflag == "2") {
						is_basic_id = item.idno;
						is_clntnum_id = item.clntnum;
					} else {
						is_basic_id = item.idno;
						is_clntnum_id = item.clntnum;
					}
				})
				let li_return = 1;
				let params = {
					"as_an1": ls_acctype,
          "as_an2": ai_an3,
					"as_an3": crtable,
					"is_dangflag": this.curAddPremData.is_dangflag,
					"is_indexflag": this.curAddPremData.is_indexflag,
					"life": this.curAddPremData.unipndPageList[0].is_lifeauths,
					"is_basic_id": is_basic_id,
					"applnum": this.curAddPremData.curApplnum,
					"userId": this.curAddPremData.unipndPageList[0].userId,
					"clntnum": is_clntnum_id,
					"polpln": polpln,
					"dw_eu001": JSON.stringify(this.curPageData.dw_eu001)
				}
				let url = appName.NEWUNDR + '/unipnd/nucleusNote/wfCheckSharein1';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {
					return 0;
				}
				if (res.resultCode == constant.SUCCESS && res.data != null) {
					li_return = res.data.flag1;
					_that.curAddPremData.is_dangflag = res.data.flag2;
					_that.curAddPremData.is_indexflag = res.data.flag3;
					_that.curAddPremData.gs_rimsg = Number(res.data.flag4);
				} else {
					li_return = 0;
				}

				return li_return;
			},
			//试算保费检查各输入值
			wfRateupCheck(as_type, object) {
				let that = this;
				let ls_del = null;
				let length = 0;
				if (this.premiumTempList) {
					length = this.premiumTempList.length;
				}
				if ((this.premiumTempVO.notedesc == "" || this.premiumTempVO.notedesc == undefined) && length != 0) {
					this.popMsg("错误：加费作业主档未输入原因,加费明细不可存在", 'error');
					return 1;
				} else {
					ls_del = "Y"; //主档有输入
				}

				for (let i = 0; i < this.premiumTempList.length; i++) {
					let item = this.premiumTempList[i];
					if (item.opcda == null || item.opcda == "") {
						this.popMsg("必要性栏位：加费类别必须输入", 'error');
						return 1;
					}
					let ld_oppc = Number(item.oppc);
					let ll_insprm = Number(item.insprm);
					let ll_zmortpct = Number(item.zmortpct);
					if (this.curAddPremObj.cnttype == "SUL") {
						if (ll_insprm == 0) {
							this.popMsg("必要性栏位：加费等级必须输入", 'error');
							return 1;
						}
					} else if (ld_oppc == 0 && ll_insprm == 0 && ll_zmortpct == 0) {
						this.popMsg("必要性栏位：加费项目不可同时为零", 'error');
						return 1;
					}
					this.curAddPremData.is_upd = "Y";
				}


				if (this.premiumTempList.length == 0) {
					let ls_pncode = null;
					let params = {
						"crtable": this.curAddPremObj.crtable
					}
					let url = appName.NEWUNDR + '/unipnd/premium/findPncodeByCrtable';
					let res = uwLoadJs.ajaxRequest(params, url);
					if (res.resultCode == constant.SUCCESS && res.data != null) {
						ls_pncode = res.data;
					}

					let eubas = [];
					this.curAddPremData.eubas.forEach(euba => {
						if (euba.pntype == "1" && euba.pncode == ls_pncode && rprntdate == 0) {

						} else {
							eubas.push(euba);
						}
					})
					this.curAddPremData.eubas = eubas;
					let datas = [];
					this.pageData.forEach(data => {
						if (data.curApplnum == this.curAddPremData.curApplnum) {
							datas.push(this.curAddPremData);
						} else {
							datas.push(data);
						}
					})
					this.pageData = datas;

					return 2;
				}


				return 0;
			},
			//特殊加费试算
			preClick(data) {
				this.preData = data;
				this.wpNum = "";
				this.pbNum = "";
				this.resultNum = "";
				this.preCalFlag = true;
			},
			keyNumPress(data) {

			},
			checkNum(data) {
				var reg = /^[0-9]*$/;
				if (!reg.test(data)) {
					this.popMsg("请输入数字", 'error');
					data = "";
					return false;
				}
			},
			preCal() {
				if (!this.wpNum && !this.pbNum) {
					this.popMsg("WP、PB栏位不能全部为空", 'error');
					return false;
				}
				if (Number(this.wpNum) == 0 && Number(this.pbNum) == 0) {
					this.popMsg("WP、PB栏位不能全部为0", 'error');
					return false;
				}
				if (!this.wpNum) {
					this.wpNum = 0;
				}
				if (!this.pbNum) {
					this.pbNum = 0;
				}
				this.resultNum = (parseInt(this.wpNum) * 0.24 + parseInt(this.pbNum) * (1 - 0.24)).toFixed(2);
			},
			preBack() {
				if (!this.wpNum || !this.pbNum) {
					this.popMsg("WP、PB栏位不能全部为空", 'error');
					return false;
				}
				if (Number(this.resultNum) == 0) {
					this.popMsg("计算结果为0，请重新输入！", 'error');
					return false;
				}

				this.preData.oppc = this.resultNum;
				this.preCalFlag = false;
			},
			//新增加费
			addClick() {
				let lt_time = uwJs.showTime();
				let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
				if ((this.curAddPremObj.cnttype.trim() == "SUL" || this.curAddPremObj.cnttype.trim() == "RUL") && this
					.premiumTempList.length > 0) {
					return false;
				} else {
					if (this.premiumTempList.length > 7) {
						this.popMsg("讯息：次标加费输入不可超过八笔记录", 'error');
						return false;
					} else {
						let ext_cess_term = 0;
						let premCessTerm = 0;
						let riskCessTerm = 0;
						if (this.curAddPremObj.prmsw == "A") {
							premCessTerm = Number(this.curAddPremObj.premCessTerm) - Number(this.curAddPremObj.age);
						} else {
							premCessTerm = this.curAddPremObj.premCessTerm
						}
						if (this.curAddPremObj.rsksw == "A") {
							riskCessTerm = Number(this.curAddPremObj.riskCessTerm) - Number(this.curAddPremObj.age);
						} else {
							riskCessTerm = this.curAddPremObj.riskCessTerm
						}
						if (this.curAddPremObj.crtable == "URB1" || this.curAddPremObj.crtable == "URB2" ||
							this.curAddPremObj.crtable == "URB3" || this.curAddPremObj.crtable == "URB4" ||
							this.curAddPremObj.crtable == "URTP" || this.curAddPremObj.crtable == "URTA" ||
							this.curAddPremObj.crtable == "URTB") {
							ext_cess_term = riskCessTerm;
						} else {
							ext_cess_term = premCessTerm;
						}


						let oppc = 0;
						if (this.curAddPremObj.polpln.indexOf("PHA") > 0) {
							oppc = this.premiumTempVO.prt;
						}
						let opcda = "";
						if (this.curAddPremObj.cnttype == "SUL") {
							opcda = "UL"; //SUL加费Default加费原因
						}

						let zmortpctBg = "B";
						let oppcBg = "B";
						console.log("新增加分项：" + this.curAddPremObj.statFund);
						let tmpCrtable = this.curAddPremObj.crtable.substr(0, 3);
						let crtable = this.curAddPremObj.crtable;
						if (this.curAddPremObj.statFund == "M") {
							if (this.curPageData.euaa.appltype == "2") {
								zmortpctBg = "RF";
							} else {
								oppcBg = "RF";
							}
							//开放百分比加费
							if (this.feeAddOPPCList && (this.feeAddOPPCList.indexOf(tmpCrtable) >= 0 || this.feeAddOPPCList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "RF";
								oppcBg = "B"
							}
							//开放TM
							if (this.feeAddTMList && (this.feeAddTMList.indexOf(tmpCrtable) >= 0 || this.feeAddTMList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "B";
								oppcBg = "RF"
							}
							//两者均开放
							if (this.feeAddTOList && (this.feeAddTOList.indexOf(tmpCrtable) >= 0 || this.feeAddTOList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "B";
								oppcBg = "B"
							} //两者均BU开放
							if (this.feeAddNOList && (this.feeAddNOList.indexOf(tmpCrtable) >= 0 || this.feeAddNOList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "RF";
								oppcBg = "RF"
							}
							//          if (this.curAddPremObj.crtable == "HLA4" || this.curAddPremObj.crtable == "HS0S") {
							//            zmortpctBg = "RF";
							//            oppcBg = "B";
							//          }
							// /* 增加HLAY判断 */
							// if(this.curAddPremObj.crtable == "HLAY"){
							// 	zmortpctBg = "RF";
							// 	oppcBg = "B"
							// }
							// /* 增加HLBA判断，放开加费百分比和TM加费 */
							// if(this.curAddPremObj.crtable == "HLBA" ){
							// 	zmortpctBg = "B";
							// 	oppcBg = "B"
							// }
							// /* 增加SHRM判断，放开TM加费 */
							// if(this.curAddPremObj.crtable == "SHRM"){
							// 	zmortpctBg = "B";
							// 	oppcBg = "RF"
							// }
							// /* 增加測試險種判断，放开TM加费 */
							// if(this.curAddPremObj.crtable =="HLAD"||this.curAddPremObj.crtable =="HLAE"||
							// 	this.curAddPremObj.crtable =="HLAG" || this.curAddPremObj.crtable =="HLAF"){
							// 	zmortpctBg = "B";
							// 	oppcBg = "B"
							// }
						} else if (this.curAddPremObj.statFund == "R") {
							console.log("新增加分项：" + this.curAddPremObj.polpln);
							if (uwJs.judgeIsSpecCrtable("INVEST_UNIVERSAL_ALL_CRTABLES", this.curAddPremObj
								.polpln)) //如果不是投连和万能险种
							{
								oppcBg = "RF";
							} else {
								zmortpctBg = "RF";
							}

							// if (this.curAddPremObj.crtable == "URTP" || this.curAddPremObj.crtable == "URTA" || this.curAddPremObj.crtable == "URTA") {
							//   zmortpctBg = "B";
							//   oppcBg = "RF";
							// }
							// if (this.curAddPremObj.crtable == "2DWD") {
							//   zmortpctBg = "B";
							//   oppcBg = "RF";
							// }
							//开放百分比加费
							if (this.feeAddOPPCList && (this.feeAddOPPCList.indexOf(tmpCrtable) >= 0 || this.feeAddOPPCList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "RF";
								oppcBg = "B"
							}
							//开放TM
							if (this.feeAddTMList && (this.feeAddTMList.indexOf(tmpCrtable) >= 0 || this.feeAddTMList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "B";
								oppcBg = "RF"
							}
							//两者均开放
							if (this.feeAddTOList && (this.feeAddTOList.indexOf(tmpCrtable) >= 0 || this.feeAddTOList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "B";
								oppcBg = "B"
							} //两者均开放
							if (this.feeAddNOList && (this.feeAddNOList.indexOf(tmpCrtable) >= 0 || this.feeAddNOList
									.indexOf(crtable) >= 0)) {
								zmortpctBg = "RF";
								oppcBg = "RF"
							}
						}
						let seqnbr = 1;
						if (this.premiumTempList.length > 0) {
							this.premiumTempList.forEach(item => {
								if (item.seqnbr > seqnbr) {
									seqnbr = item.seqnbr;
								}
							})
							seqnbr += 1;
						}
						let premiumTemp = {
							checked: false,
							zmortpctBg: zmortpctBg,
							oppcBg: oppcBg,
							applnum: this.curAddPremObj.applnum,
							chdrnum: this.curAddPremObj.chdrnum,
							clntnum: this.curAddPremObj.clntnum,
							polpln: this.curAddPremObj.polpln,
							seqnbr: seqnbr,
							reasind: "1",
							agerate: "0",
							sbstdl: "Y",
							znadjperc: "0",
							crtuser: this.curAddPremData.unipndPageList[0].userId,
							dtecrt: this.curAddPremData.unipndPageList[0].lda_date,
							crttime: ll_time1,
							jobName: uwconstant.jobName,
							userProfile: this.curAddPremData.unipndPageList[0].userId,
							datime: this.initTime(),
							opcda: opcda,
							extCessTerm: ext_cess_term,
							insprm: 0,
							oppc: oppc,
							zmortpct: 0,
							zlinstprem: 0
						}

						this.premiumTempList.push(premiumTemp);
						this.curAddPremData.is_calc = "Y";

						console.log(this.premiumTempList)
					}
				}
			},
			//删除加费
			delClick(data) {
				data.checked = true;
				this.premiumTempList = this.premiumTempList.filter(item => !item.checked);

				this.calcClick("rate", 1);

				this.curAddPremData.is_calc = "Y";
			},
			//加费除外 删除加费
			delClick1(data) {
				data.checked = true;
				this.premiumTempList = this.premiumTempList.filter(item => !item.checked);

				this.calcClick("rate", 2);

				this.curAddPremData.is_calc = "Y";
			},
			/***************************加费 END**********************************************/

			// 组件部分方法开始---
			// 投保记录
			getSubRecordFlag(e) {
				this.recordFlag = e;
			},
      // 第二被保人投保记录
      getSecondSubRecordFlag(e) {
        this.secondRecordFlag = e;
      },

			// 客户投诉记录
			getSubComplainFlag(e) {
				this.complainFlag = e;
			},
      // 第二被保人客户投诉记录
      getSecondSubComplainFlag(e) {
        this.secondComplainFlag = e;
      },
			// 累计保额
			getSubCumAmountFlag(e) {
				this.cumAmountFlag = e;
			},
      // 第二被保人累计保额
      getSecondSubCumAmountFlag(e) {
        this.secondCumAmountFlag = e;
      },

			// 理赔记录
			getSubClaimsFlag(e) {
				this.claimsFlag = e;
			},
      // 第二被保人理赔记录
      getSecondSubClaimsFlag(e) {
        this.secondClaimsFlag = e;
      },

			// 保全记录
			getSubSaveDamageFlag(e) {
				this.saveDamageFlag = e;
			},
      // 第二被保人保全记录
      getSecondSubSaveDamageFlag(e) {
        this.secondSaveDamageFlag = e;
      },

			// 异常告知一览
			getSubAbnormityFlag(e) {
				this.abnormityFlag = e;
			},
      // 第二被保人异常告知一览
      getSecondSubAbnormityFlag(e) {
        this.secondAbnormityFlag = e;
      },

			// 补充告知书一览
			getSubReportFlag(e) {
				this.reportFlag = e;
			},
      // 第二被保人补充告知书一览
      getSecondSubReportFlag(e) {
        this.secondReportFlag = e;
      },

			// 提交报告
			getSubHealthFlag(e) {
				this.healthFlag = e;
			},
      // 第二被保人体检报告一览
      getSecondSubHealthFlag(e) {
        this.secondHealthFlag = e;
      },

			// Notepad
			getSubNotepadFlag(e) {
				this.notepadFlag = e;
			},
      // 第二被保人Notepad
      getSecondSubNotepadFlag(e) {
        this.secondNotepadFlag = e;
      },
			getInsNoteSize(e) {
				this.insNoteSize = e;
			},
      getSecondInsNoteSize(e) {
        this.secondInsNoteSize = e;
      },
			getAppNoteSize(e) {
				this.appNoteSize = e;
			},


			// 复核意见
			getSubReviewFlag(e) {
				this.reviewFlag = e;
			},
      // 第二被保人续核记录
      getSecondSubReviewFlag(e) {
        this.secondReviewFlag = e;
      },

			// 预核保
			getSubPreFlag(e) {
				this.presFlag = e;
			},
      // 第二被保人预核保
      getSecondSubPreFlag(e) {
        this.secondPresFlag = e;
      },
			//******************************投保人**********************************//
			// 投保记录
			getAppRecordFlag(e) {
				this.appRecordFlag = e;
			},

			// 客户投诉记录
			getAppComplainFlag(e) {
				this.appComplainFlag = e;
			},

			// 累计保额
			getAppCumAmountFlag(e) {
				this.appCumAmountFlag = e;
			},

			// 理赔记录
			getAppClaimsFlag(e) {
				this.appClaimsFlag = e;
			},

			// 保全记录
			getAppSaveDamageFlag(e) {
				this.appSaveDamageFlag = e;
			},

			// 异常告知一览
			getAppAbnormityFlag(e) {
				this.appAbnormityFlag = e;
			},

			// 补充告知书一览
			getAppReportFlag(e) {
				this.appReportFlag = e;
			},

			// 委托人信息
			getAppConsignorFlag(e) {
				this.appConsignorFlag = e;
			},

			// 提交报告
			getAppHealthFlag(e) {
				this.appHealthFlag = e;
			},

			// Notepad
			getAppNotepadFlag(e) {
				this.appNotepadFlag = e;
			},

			// 个人税收居民身份证明
			getAppIDFlag(e) {
				this.appIDFlag = e;
			},

			// 复核意见
			getAppReviewFlag(e) {
				this.appReviewFlag = e;
			},
			//客户查询
			getSubAppCusFlag(e) {
				this.appCusFlag = e;
			},
			getSubInsCusFlag(e) {
				this.insCusFlag = e;
			},
      // 第二被保人客户查询
      getSecondSubInsCusFlag(e) {
        this.secondInsCusFlag = e;
      },

			getRouterData() {
				this.applnum = this.$route.params.applnum;
				this.pageSource = this.$route.params.pageSource;

				// let isOpen = sessionStorage.getItem(this.applnum);
				// this.isOpen
				let arrs = this.$store.getters['loading/GET_IS_OPEN']
				let flag = false;
				if (arrs.length > 0) {
					arrs.map(item => {
						if (item == this.applnum) {
							flag = true;
						}
					})
				}
				this.isOpen = flag;
				if (this.pageSource == uwconstant.pages.jd) {
					if (!this.isOpen) {
						this.doUwClick();
					} else {
						if (!this.pageData || this.pageData.length == 0) {
							this.doUwClick();
						}
					}
				} else {
					if (!this.isOpen) {
						let url = appName.NEWUNDR + '/unipnd/check/checkDate';
						let res = uwLoadJs.ajaxRequest({}, url);

						if (res.resultCode == constant.SUCCESS) {
							this.doUwClick();
						} else {
							this.$confirm(res.resultMsg, '提示', {
								confirmButtonText: '确定',
								cancelButtonText: '取消',
								type: 'warning'
							}).then(() => {
								this.doUwClick();
							}).catch(() => {
								this.back();
							});
						}
						// sessionStorage.setItem(this.applnum,true);
					} else {
						if (!this.pageData || this.pageData.length == 0) {
							let url = appName.NEWUNDR + '/unipnd/check/checkDate';
							let res = uwLoadJs.ajaxRequest({}, url);

							if (res.resultCode == constant.SUCCESS) {
								this.doUwClick();
							} else {
								this.$confirm(res.resultMsg, '提示', {
									confirmButtonText: '确定',
									cancelButtonText: '取消',
									type: 'warning'
								}).then(() => {
									this.doUwClick();
								}).catch(() => {
									this.back();
								});
							}
						}
					}


				}

				// //资料修正、特别事项、核保列表、建档
				// if(this.pageSource !=uwconstant.pages.zlxz && this.pageSource !=uwconstant.pages.hebao
				//   && this.pageSource != uwconstant.pages.jd
				//   && this.pageSource != uwconstant.pages.zlxz ){
				//   this.$message({
				//     message: "页面不明传参",
				//     type: 'error'
				//   });
				//   this.back();
				// }
				console.log("init........" + this.applnum)

			},

			compareData() {
				//      console.log(this.pageData);
				let obj = {
					isChange: false,
					msg: ''
				}
				let str_trailer4 = '';
				let str_eubas = '';
				let str_trailer13 = '';
				this.pageData.map(item => {
					item.trailer4.map(item2 => {
						str_trailer4 += item2.approval;
					})
					item.eubas.map(item2 => {
						str_eubas += item2.procflg;
						str_eubas += item2.pedesc;
					})
					item.trailer13.map(item2 => {
						str_trailer13 += item2.bmntdesc;
					})
				})
				if (str_trailer4 != this.compare.trailer4) {
					obj.isChange = true;
					obj.msg = '投保计划修改未保存,是否确定关闭页面?';
					return obj;
				}
				if (str_eubas != this.compare.eubas) {
					obj.isChange = true;
					obj.msg = '照会内容修改未保存,是否确定关闭页面?';
					return obj;
				}
				if (str_trailer13 != this.compare.trailer13) {
					obj.isChange = true;
					obj.msg = '复核意见修改未保存,是否确定关闭页面?';
					return obj;
				}
				return obj;
			},
			saveCompareData() {
				this.compare.trailer4 = '';
				this.compare.eubas = '';
				this.compare.trailer13 = '';
				this.pageData.forEach(ply => {
					ply.trailer4.forEach(item => {
						this.compare.trailer4 += item.approval;
						console.log('compare_投保计划')
						console.log(this.compare.trailer4)
					});
					ply.eubas.forEach(item => {
						console.log('compare_照会')
						this.compare.eubas += item.procflg;
						this.compare.eubas += item.pedesc;
						console.log(this.compare.eubas)
					});
					ply.trailer13.forEach(item => {
						console.log('compare_复核意见')
						this.compare.trailer13 += item.bmntdesc;
						console.log(this.compare.trailer13)
					});
				})
			},
			//减去延期拒保
			subtractPD() {
				let sum = 0;
				let sum1 = 0;
				this.pageData.forEach(item => {
					item.trailer4.forEach(data => {
						if (data.approval != "D" && data.approval != "P") {
							sum = sum + data.instprem;
							sum1 = sum1 + data.firstprem;
						}
					})
					item.instpremTotal = sum;
					item.firstpremTotal = sum1;
					sum = 0
					sum1 = 0
				})
			},
			// IE内存释放优化代码修改
			saveByF8(event) {
				var e = event || window.event || arguments.callee.caller.arguments[0];
				if (e && e.keyCode == 9) {
					this.tapPncode();
				}

				//F8保存
				if (e && e.keyCode == 119) {
					this.beforeSaveInfo();
				}
			},
			selectInit(row, index, a) {
				this.selectRow(row, index);
			},
			//修改AI体检单勾选选项
			handleSelectionChangeMedical(val) {
				this.medicalmultipleSelection = val;
			},
			//增加tabs切换点击事件监听
			handletabsClick(tab, event) {
				if (tab.name == 'three') {
          this.getAiTask()
					/* this.medicalReportData();
					this.queryChooseSize(); */
				}
			},
      getAiTask(){
        this.medicals = []
        this.templateSelection = ''
        this.checkList = []
        let params = {
          applNum: this.curPageData.curApplnum,
          chdrNum: this.curPageData.chdrnum,
          /* applNum: '0518130',
          chdrNum: '02300512' */
        }
        this.$store.dispatch('loading/CHANGE_LOADING', true);
        getAiTaskApi(params).then(res => {
          this.$store.dispatch('loading/CHANGE_LOADING', false);
					if (res.resultCode == constant.SUCCESS) {
						this.medicals = res.data || []
            this.medicals.forEach((item,index)=>{
              item._id = index + 1
            })
					}
				}).catch(err => {
					this.$store.dispatch('loading/CHANGE_LOADING', false);
				})
      },
			queryChooseSize() {
				queryChooseSize().then(res => {
					if (res.resultCode == constant.SUCCESS) {
						console.log("获取AI核保影像个数控制为：" + res.data);
						this.selectChooseSize = res.data;
					} else {
						console.log("获取AI核保影像个数失败，默认设置为3个");
						//查询失败，默认给3
						this.selectChooseSize = 3;
					}
				}).catch(err => {
					console.log("获取AI核保影像个数失败，默认设置为3个");
					//查询失败，默认给3
					this.selectChooseSize = 3;
				})
			},
			//AI核保查询体检数据，并查询是否被发起过AI核保
			async medicalReportData() {
				let that = this;
				let userId = "";
				let clntnum = this.insTabInfo.clntnum;
				let pageSize = that.paginations.pageSize;
				let pageIndex = that.paginations.pageIndex;
				if (sessionStorage.getItem("loginForm")) {
					let loginForm = JSON.parse(sessionStorage.getItem("loginForm"));
					userId = loginForm.userName;
				}
				that.$emit('showLoading', true);
				let policyNos = "";
				let params = {
					"clntnum": clntnum
				}
				let url = appName.NEWUNDR + '/unipnd/euab/getChdrnumByClntnum';
				let res = uwLoadJs.ajaxRequest(params, url);
				if (res == null) {

				} else if (res.data != null) {
					if (res.data.length > 0) {
						res.data.forEach(item => {
							policyNos = policyNos + item + ",";
						})
					}
					if (policyNos.indexOf(",") != -1) {
						policyNos = policyNos.substring(0, policyNos.length - 1);
					}
				}
				that.medicals = [];
				if (policyNos != "") {
					let doctype = "体检报告单,`体检报告单,门诊病历,其他病历资料,`门诊病历,`其他病历资料,病历资料,承保后调查报告";
					let docType = doctype
					let params1 = {
						"begintime": "",
						"birthday": "",
						"branchCode": "",
						"busiNO": "",
						"busiType": "NB",
						"comCode": "",
						"docType": docType,
						"doflag": "caseimage",
						"groupNO": "",
						"imgsort": "",
						"imgsortorder1": "",
						"imgsortorder2": "",
						"imgsortorder3": "",
						"insured": "",
						"isNoCaseno": "",
						"isPrint": "",
						"policyer": "",
						"policyNO": policyNos ? policyNos : "",
						"policyno16": "",
						"productType": "",
						"serno": "",
						"stockID": "",
						"sproductType": "",
						"spurview": "query",
						"stype": "general"
					}
					let list = [];
					await ImageQuerySearch(params1, userId, pageSize, pageIndex).then(res => {
						that.$emit('showLoading', false);

						if (res.resultCode == constant.SUCCESS && res.resBody) {
							if (res.strDoFlag == "image" || res.strDoFlag == "caseimage") {
								for (var i = 0; i < res.resBody.imageList.length; i++) {
									const obj = {
										serno: res.resBody.imageList[i].serno,
										docTyp: res.resBody.imageList[i].docTyp,
										stockID: res.resBody.imageList[i].stockID,
										groupNo: res.resBody.imageList[i].groupNo,
										scanDate: res.resBody.imageList[i].scanDate,
										scanTime: res.resBody.imageList[i].scanTime,
										subbusitype: res.resBody.imageList[i].subbusitype,
										isPrint: res.resBody.imageList[i].isPrint,
										remark: res.resBody.imageList[i].remark,
										busiType: res.resBody.imageList[i].busiType,
										itemid: res.resBody.imageList[i].itemid,
										policyNo: res.resBody.imageList[i].policyNo,
										busiNo: res.resBody.imageList[i].busiNo,
										productType: res.resBody.imageList[i].productType,
										ishcprint: res.resBody.imageList[i].ishcprint,
										version: res.resBody.imageList[i].version,
										agentNo: res.resBody.imageList[i].agentNo,
										updateflag: res.resBody.imageList[i].updateflag,
									}
									list.push(obj);
								}
								that.paginations.total = res.resBody.total;
							}
						}
					}).catch(err => {

					})
					await seeAiList(this.curPageData.chdrnum).then(res => {
						if (res.resultCode == constant.SUCCESS && res.data) {
							let aiList = res.data;
							let ids = "";
							aiList.forEach(item => {
								ids += item.itemids + ",";
							})
							list.forEach(ite => {
								if (ids.indexOf(ite.itemid) >= 0) {
									ite["isAI"] = 0;
								}
								that.medicals.push(ite)
							})
						}
					})

				}
				that.$emit('showLoading', false);
			},
			//发起AI核保
			callAihebao() {
				if (this.medicalmultipleSelection.length > 0) {
					if (this.medicalmultipleSelection.length > this.selectChooseSize) {
						this.popMsg("勾选影像个数超过了设定的" + this.selectChooseSize + '个！', 'error');
						return;
					}
					let param = {
						euaa: this.curPageData.euaa,
						euab: this.curPageData.trailer4,
						chdrnum: this.curPageData.chdrnum,
						applnum: this.curPageData.curApplnum,
						insure: this.curPageData.insBaseInfo,
						policy: this.curPageData.appLasInfo
					}
					let itemids = "";
					this.medicalmultipleSelection.forEach(item => {
						itemids = itemids + item.itemid + ",";
					})
					param['itemids'] = itemids;
					callAihebao(param).then(res => {
						if (res.resultCode == constant.SUCCESS) {
							this.popMsg("AI核保发起成功！", 'success');
							//刷新
							this.medicalReportData();
						}
					})
				} else {
					this.popMsg("请勾选影像", 'error');
				}
			},
      AiDetail(){
        this.aiPages.pageIndex = 1
        this.aiPages.pageSize = 10
        this.seeAiList(true)
      },
      aiCurrentChange(page){
        this.aiPages.pageIndex = page
        this.seeAiList()
      },
      aiSizeChange(pageSize){
        this.aiPages.pageSize = pageSize
        this.seeAiList()
      },
      // 查看AI详情
			seeAiList(flag) {
        let chdrNum = '', accepted = '', mainId = '',peCode = ''
        if(!flag){
          if(this.checkList.length < 1) {
					  return this.popMsg("请选择一条数据", 'error');
				  }
          chdrNum = this.checkList[0].chdrNum
          accepted = this.checkList[0].accepted
          mainId = this.checkList[0].mainId
          peCode = this.checkList[0].peCode
				  this.aihebaoFlag = true
        }else{
          chdrNum = this.medicals[0].chdrNum
          accepted = this.medicals[0].accepted
          mainId = this.medicals[0].mainId
          peCode = this.medicals[0].peCode
        }
				
        this.aihebaolistData = []
        let params = {
          applNum: accepted,
	        chdrNum: chdrNum,
	        mainId: mainId,
          peCode,
          pageNum: this.aiPages.pageIndex, 
          pageSize: this.aiPages.pageSize
        }
        this.aiLoading = true
        getAiTaskRecordApi(params).then(res => {
          this.aiLoading = false
					if (res.resultCode == constant.SUCCESS) {
						this.aihebaolistData = res.data.list || []
            if(flag && this.aihebaolistData.length) this.seeDetail(this.aihebaolistData[0])
            this.aiPages.total = res.data?.total ? res.data.total : 0
					}
				}).catch(err=>{
          this.aiLoading = false
        })
			},
      singleElection(row) {
        this.templateSelection = row._id
        this.checkList = this.medicals.filter((item) => item._id === row._id)
      },
      // 手工补录
      recordAihebao(){
        console.log(this.checkList,'checkList');
				if(this.checkList.length < 1) {
					return this.popMsg("请选择一条数据", 'error');
				}
				let { itemId, itemNo, mainId, peCode, accepted,chdrNum } = this.checkList[0];
				let userId = this.userId;
				this.$store.dispatch('loading/CHANGE_LOADING', true);
				repairAiTask({ itemId, itemNo, mainId, peCode, userId }).then(res => {
          this.$store.dispatch('loading/CHANGE_LOADING', false);
					if (res.resultCode == constant.SUCCESS && res.data != null && res.resultMsg != '请求成功') {
						let query = Object.assign({accepted, taskNo: itemNo,chdrNum}, res.data)
						query.aiTask = true,
						query.taskNo = query.itemTaskNo,
            sessionStorage.setItem('manualRecord',JSON.stringify(query))
						this.$router.push({path: "/home/taskCenter/manualRecord"});
					} else {
						that.popMsg(res.resultMsg, 'error');
					}
				}).catch(err => {
					this.$store.dispatch('loading/CHANGE_LOADING', false);
				})
      },
			seeDetail(row) {
        this.aihebaoFlag = false;
        sessionStorage.setItem('underwritingDetailInfo',JSON.stringify(row))
        this.$router.push({
          path: "/home/maintenance/robouUnderwriting/intelligenceRule/underwritingDetail"
        })
			},
			jump() {
				document.getElementsByClassName("underwriting-base")[0].scrollIntoView({
					behavior: "smooth", // 平滑过渡
					block: "start" // 上边框与视窗顶部平齐。默认值
				});
			},
			selectAiItem(row) {
        this.checkList = []
        this.checkList.push(row)
			}
		},
		deactivated() {
			document.onkeydown = null;
			console.log("对象onkeydown事件销毁完成！");
		},

		//页面初始化调用doUwClick
		created() {
      this.getCodeDictProject()
			// this.getRouterData();
			// this.doUwClick();
		},
		activated() {
      this.activeName5 = 'one'
			this.$destroyCacheKey()
			this.getRouterData();

			document.onkeydown = this.saveByF8;
			/* IE内存释放优化代码修改
			document.onkeydown = (event)=>{
			  var e = event || window.event || arguments.callee.caller.arguments[0];
			  if (e && e.keyCode == 9) {
			      this.tapPncode();
			  }

			  //F8保存
			  if (e && e.keyCode == 119) {
			      this.beforeSaveInfo();
			  }
			};
			*/
			// this.doUwClick();
		},

		watch: {
			pageData: {
				handler(newVal, oldVal) {
					console.log('watch')
					let obj = this.compareData();
					console.log(obj)
					this.$store.dispatch('setHebaoDataChange', obj)
					console.log(new Date().getTime())
				},
				deep: true
			}
		},
		// beforeRouteLeave(to,from,next){
		//   to.meta.keepAlive = true;    // B跳转到A时，让A缓存，即不刷新
		//   next()
		// },
		destroyed() {
			document.onkeydown = null;
			document.removeEventListener('click', this.clickEvent)
			clearTimeout(this.printPnTimeOut1)
			clearTimeout(this.printPnTimeOut2)
			clearTimeout(this.backTimeOut)
			clearTimeout(this.cancelApproTimeOut)
			clearTimeout(this.saveAllInfoTimeOut)
			clearTimeout(this.savePageDataTimeOut)
			clearTimeout(this.doUwClickTimeOut)
			clearTimeout(this.initUwPageTimeOut)
			clearTimeout(this.initDataTimeOut1)
			clearTimeout(this.initDataTimeOut2)
			clearTimeout(this.initDataTimeOut3)
			clearTimeout(this.initDataTimeOut4)
			clearTimeout(this.initDataTimeOut5)
			clearTimeout(this.appindChangedTimeOut)
			clearTimeout(this.changeConclusionsTimeOut)
			clearTimeout(this.decideChangedTimeOut)
			clearTimeout(this.savePostilTimeOut)
			clearTimeout(this.addPremSureTimeOut)
			clearTimeout(this.calcClickTimeOut)
		},
		//页面管道信息
		filters: {
			procflgPige: function(value) {
				return procflgPige(value);
			},
			billfreqPige: function(value) {
				return billfreqPige(value);
			},
			mmflgPige: function(value) {
				return mmflgPige(value);
			},
			cltsexPipe: function(value) {
				return cltsexPipe(value);
			},
			fieldTypePipe: function(value) {
				return fieldTypePipe(value);
			},
			cerityPipe: function(value) {
				return cerityPipe(value);
			},
			cltypePipe: function(value) {
				return cltypePipe(value);
			},
			risklvlPipe: function(value) {
				return risklvlPipe(value);
			},
			busiTypePipe: function(value) {
				return busiTypePipe(value);
			},
			aiTaskstatusNewPipe: function(value) {
				return aiTaskstatusNewPipe(value);
			}
		}
	}
</script>
<style lang="less" scoped>
	.underwriting {
		background: #f5f5f5;
		position: relative;

		// .base-title .el-tabs__nav { //2020-03-27
		//     padding: 0 20px;
		// }
		.demoTwo {
			width: 100%;
			height: 300px;
			background-color: #333333;
			position: relative;
		}

		.underwriting-base {
			position: relative;

			// .el-tabs__nav {
			//     padding: 0 20px;
			// }
			.el-tabs__active-bar {
				//2020-03-27
				left: 20px !important;
			}

			.base-title {
				background: #fff;

				.item-title {
					padding: 20px;

					.item {
						display: inline-block;
						margin-bottom: 15px;
						cursor: pointer;
					}

					.item:hover {
						//2020-03-27
						cursor: pointer;
						color: #68A3FC;
					}
				}
			}

			.base-mian {

				border: 1px solid #e1e1e1;
				border-radius: 4px;
				background: #f5f5f5;

				.base-mian-cell {
					margin-top: 10px;
					background: #fff;

					.base-mian-cell-title {
						padding: 0 20px;
						height: 50px;
						line-height: 50px;
						border-bottom: 1px solid #e1e1e1;

						.left {
							.line {
								color: #f76767;
							}

							.tips {
								margin-left: 15px;
								// color: #333;//2020-03-27
							}
						}

						.right {
							padding: 0 20px;
							cursor: pointer;

							.el-icon-circle-close {
								color: #909399;
								font-size: 24px;
							}
						}
					}

					.base-mian-cell-main {
						padding: 20px;
					}
				}
			}
		}



		.txt-line {
			color: #68A3FC;
			text-decoration: underline;
			cursor: pointer;
		}

		.txt {
			color: #68A3FC;
			cursor: pointer;
		}

		.complain-lab {
			line-height: 28px;
			text-align: right;
			display: block;
			padding-right: 10px;
			box-sizing: border-box;
		}

		.mb10 {
			margin-bottom: 10px;
		}

		.com-title {
			background: #f5f5f5;
			height: 40px;
			line-height: 40px;
			padding: 0 20px;

			.left {
				.line {
					color: #f76767;
				}

				.tips {
					margin-left: 15px;
				}
			}
		}

		.check-main {
			padding: 20px 20px 0 20px;
			cursor: pointer;
		}

		.check-info {
			height: 36px;
			padding: 0 20px;
			border: 1px solid #f76565;
			border-radius: 3px;
			color: #f76565;
			background: #fff;
			cursor: pointer;
		}

		.check-info-def {
			height: 36px;
			padding: 0 20px;
			border: 1px solid #e1e1e1;
			border-radius: 3px;
			color: #666;
			background: #fff;
			cursor: pointer;
		}

		.edit-main {
			text-align: center;
			margin-top: 15px;
			cursor: pointer;

			button {
				height: 36px;
				padding: 0 30px;
				color: #fff;
				background: #f76565;
				border-radius: 4px;
			}
		}

		.com-txt {
			line-height: 28px;
		}

		.com-txt-line {
			line-height: 28px;
			color: #68A3FC;
			text-decoration: underline;
			cursor: pointer;
		}

		.policy-main {
			margin-top: 10px;
			background: #fff;
			position: relative;

			.policy-main-title {
				height: 40px;
				line-height: 40px;
				padding: 0 20px;
				box-sizing: border-box;
				border-bottom: 1px solid #e1e1e1;

				span {
					margin-left: 8px;
				}
			}

			.policy-main-container {
				padding: 20px;

				.tabs {
					.tabs-item {
						div {
							height: 40px;
							line-height: 40px;
							padding: 0 20px;
							border-radius: 4px 4px 0 0;
							background: #f2f2f2;
							text-align: center;
							cursor: pointer;

							&.active {
								background: #f76565;
								color: #fff;
							}
						}
					}
				}

				.main {
					padding: 20px;
					border: 1px solid #e1e1e1;

					.main-cell {
						.main-cell-title {
							height: 42px;
							line-height: 42px;
							background: #f2f2f2; //2020-03-27
							margin: 10px 0;
							padding-left: 12px;

							.line {
								color: #f76767;
								margin-right: 8px;
							}
						}
					}
				}
			}
		}

		.com-block {
			padding: 0 10px;
			height: 40px;
			line-height: 40px;
			background: #f5f5f5;

			.com-price {
				color: #FF0000;
			}
		}

		.com-checkbox {
			padding: 0 10px;
			line-height: 36px;
		}

		.com-lab {
			line-height: 36px;
			height: 36px;
			padding: 0 10px;
			text-align: right;
		}

		.com-select {
			height: 36px;
			line-height: 36px;
		}

		.position-re {
			position: relative;
		}

		.position-abs {
			position: absolute;
		}

		.posi-abs-top {
			position: absolute;
			right: 20px;
			top: 10px;
			cursor: pointer;

			.lab {
				// color: #00C1DE;
				color: #68a3fc;
				cursor: pointer;
			}
		}


		.position-abs-left {
			position: absolute;
			top: 12px;
			z-index: 10;
			left: 380px;
			color: #68A3FC;
			text-decoration: underline;

			.lab {
				cursor: pointer;
			}
		}

		.position-abs-right {
			position: absolute;
			top: 12px;
			z-index: 10;
			right: 20px;
			color: #68A3FC;
			text-decoration: underline;

			.lab {
				cursor: pointer;
			}
		}

		.pic-select-mian {
			position: relative;
		}

		.select-main {
			width: 50%;
			position: absolute;
			background: #fff;
			border-radius: 4px;
			top: 20%;
			z-index: 100000;
			padding: 20px;
			box-shadow: 0 0 10px #e1e1e1;

			.back-con {
				text-align: center;

				button {
					height: 30px;
					padding: 0 20px;
					background: #fff;
					border: 1px solid #e1e1e1;
					border-radius: 4px;
					cursor: pointer;

					&:hover {
						color: #f56c6c;
						background: #fef0f0;
						border-color: #fbc4c4;
					}
				}
			}
		}

		.except-main {
			width: 50%;
			position: absolute;
			background: #fff;
			border-radius: 4px;
			top: 20%;
			z-index: 1000;
			padding: 20px;
			box-shadow: 0 0 10px #e1e1e1;
			z-index: 10000;
			height: 400px;
			overflow: auto;

			.back-con {
				text-align: center;

				button {
					height: 30px;
					padding: 0 20px;
					background: #fff;
					border: 1px solid #e1e1e1;
					border-radius: 4px;
					cursor: pointer;

					&:hover {
						color: #f56c6c;
						background: #fef0f0;
						border-color: #fbc4c4;
					}
				}
			}
		}

		.note-main {
			.txt-content {
				float: left;
			}

			.note-logo-con {
				overflow: hidden;
				width: 40%;
			}

			.note-txt-con {
				width: 58%;
			}

			.note-logo {
				width: 100%;
				margin: 0 auto;
				display: block;
			}

			.tit {
				color: #000;
				font-weight: 600;
			}

			.tip {
				color: #000;
				text-indent: 28px;
				margin-top: 5px;
			}

			.com-note {
				padding: 0 0 0 56px;
				color: #000;

				.com-txt {
					.txt {
						color: #000;
						cursor: inherit;
					}
				}
			}

			.como-title {
				color: #000;
			}

			.com-title-txt {
				color: #000;
				text-indent: 28px;
				margin-top: 5px;
			}


			.com-bom-txt {
				color: #000;
				text-align: right;
				margin-bottom: 5px;

				.sign {
					display: inline-block;
					width: 100px;
					border-bottom: 1px solid #333;
				}

				.si {
					display: inline-block;
					width: 35px;
					border-bottom: 1px solid #333;
				}
			}

			.com-center-tit {
				text-align: center;
				color: #000;
				margin-bottom: 15px;
			}

			.com-center-list {
				li {
					list-style: circle;
					color: #000;
				}
			}

			.com-center-bom {
				color: #000;
				margin-top: 10px;
			}

		}

		.note-logo {
			width: 200px;
		}

		.print-pop {
			position: fixed;
			top: 0;
			left: 0;
			bottom: 0;
			width: 100%;
			height: 100%;
			background: #fff;
			z-index: 1001
		}
	}

	.person .div-txt {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
  /deep/ .aihebao .el-loading-mask{
    background: rgba(255, 255, 255, .5) !important;
  }
</style>
